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 ...
  • zzukun
  • zzukun
  • 2012年08月04日 15:50
  • 213

ZOJ 1715 When Can We Meet?

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

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...

北大ACM poj2028 When Can We Meet?

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

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

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

POJ2028——When Can We Meet?

When Can We Meet? Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 5461 ...
  • LDUtyk
  • LDUtyk
  • 2016年09月11日 00:11
  • 343

POJ 2028 When Can We Meet? 枚举

When Can We Meet? Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 5525 ...
  • LZK1997
  • LZK1997
  • 2017年03月07日 17:22
  • 162

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     当我们青春年少时,感觉世界似乎过于...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:zoj 1751 When Can We Meet?
举报原因:
原因补充:

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