hdu 4505(小Q系列故事——电梯里的爱情)

#include<stdio.h>
#include<string.h>
#include<map>
#include<algorithm>
using namespace std;
int main()
{
    int C,N,x,k,h;
    int time;
    map<int ,int>m;
    map<int ,int>::iterator it;
    scanf("%d",&C);
    while(C--)
    {
        m.clear();
        k=0;//记录不同的层数
        scanf("%d",&N);
        for(int i=0;i<N;i++)
        {
            scanf("%d",&x);
            m[x]++;
        }
        for(it=m.begin();it!=m.end();it++)
        k++;
        it--;
        h=it->first;//最高层
        //printf("%d%d%d\n",h,N,k);
        time=10*h+N+5*k;
        printf("%d\n",time);
        //for(it=m.begin();it!=it.end();it++)
    }
    return 0;
}

 

你可能感兴趣的:(HDU)