您的位置:首页 > 其它

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

2013-04-18 16:29 211 查看
#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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: