ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Codeforces 1243A

2019-11-07 12:00:51  阅读:65  来源: 互联网

标签:1024 1243A int max scanf Codeforces num include



#include <stdio.h>
#include <string.h>

int num[1024];

int main()
{
	int k;
	int n;
	int temp;
	scanf("%d", &k);
	while(k--)
	{
		memset(num, 0, sizeof(int)*1024);
		scanf("%d", &n);
		int i;
		int max=1;
		for(i=0; i<n; ++i)
		{
			scanf("%d", &temp);
			int j;
			for(j=1; j<=temp; ++j)
				++num[j];
		}
		for(i=1; i<=n; ++i)
		{
			//printf("num[%d]=%d\n", i, num[i]);
			if(num[i]>=i)
				max=i;
		}
		printf("%d\n", max);
	}
	return 0;
}

  



标签:1024,1243A,int,max,scanf,Codeforces,num,include
来源: https://www.cnblogs.com/commario/p/11811245.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有