zoj 1751 When Can We Meet?

原创 2012年03月24日 20:47:52
#include "iostream"
#include "memory.h"
#include "algorithm"
using namespace std;

int num[100];
int ans[100];

int main()
{
	int committe, quorum, M, i, j, temp1, temp2;
	bool tag;
	while (cin >> committe >> quorum && committe && quorum)
	{
		memset(num, 0, sizeof(num));
		memset(ans, 0, sizeof(ans));
		tag = false;
		for (i = 0; i < committe; i++)
		{
			cin >> M;
			for (j = 0; j < M; j++)
			{
					cin >> num[j];
					ans[num[j]]++;
			}
		}
		temp1 = temp2 = 0;
		for (i = 0; i < 100; i++)
		{
			if (ans[i] >= quorum)
			{
				if (ans[i] > temp1)
				{
					temp1 = ans[i];
					temp2 = i;
				}
				tag = true;
			}
		}
		if (tag)
			cout << temp2 << endl;
		else
			cout << "0" << endl;
	}
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

zoj1715---------------------When Can We Meet?

The ICPC committee would like to have its meeting as soon as possible to address every little issue ...

ZOJ 1715 When Can We Meet?

When Can We Meet? Time Limit: 2 Seconds      Memory Limit: 65536 KB The ICPC committee would l...

POJ 2028 When Can We Meet? 枚举

When Can We Meet? Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 5525 ...

poj解题报告——poj 2028 When Can We Meet?

原题入口poj 2028 When Can We Meet? The ICPC committee would like to have its meeting as soon as possible...

POJ 2028 When Can We Meet?(我的水题之路——边输入,边搜索)

When Can We Meet? Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3489 ...

北大ACM poj2028 When Can We Meet?

When Can We Meet?   Description The ICPC committee would like to have its meeting as soon as poss...

POJ2028——When Can We Meet?

When Can We Meet? Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 5461 ...

POJ 2028 When Can We Meet?(模拟)

When Can We Meet? Description The ICPC committee would like to have its meeting as soon as possi...

When We Were Young(年少轻狂时)

三个火枪手的的结尾曲,很好听,歌词也挺好:           When we were young the world seemed so old     当我们青春年少时,感觉世界似乎过于...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)