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

题目链接: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;
}


你可能感兴趣的:(hdu4505 小Q系列故事——电梯里的爱情)