您的位置:首页 > 其它

hdu4505 小Q系列故事——电梯里的爱情

2013-09-22 15:43 309 查看
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4505

#include <stdio.h>
#include <string.h>
#define MAXN 101

int main()
{
int n,Max,cnt,i,x,test;
int height[MAXN];
scanf("%d",&test);
while(test--)
{
scanf("%d",&n);
Max=cnt=0;
memset(height,0,sizeof(height));
for(i=0;i<n;++i)
{
scanf("%d",&x);
if(height[x]==0)
cnt++;//电梯门开几次
height[x]++;
if(x>Max)
Max=x;
}
printf("%d\n",10*Max+cnt*5+n);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: