比赛 NOIP水题争霸赛 评测结果 AAAAAAAAAA
题目名称 打扑克 最终得分 100
用户昵称 サイタマ 运行时间 0.008 s
代码语言 C++ 内存使用 0.17 MiB
提交时间 2018-02-11 19:37:57
显示代码纯文本
#include<fstream>
using namespace std;
ifstream cin("poker1.in");
ofstream cout("poker1.out");
int m;
int main()
{
	cin>>m;
	while(m--)
	{
		int n;
		cin>>n;
		int poker[14]={0};
		for(int i=1;i<=n;i++)
		{
			int card;
			cin>>card;
			poker[card]++;
		}
		for(int i=1;i<=13;i++)
		{
			if(poker[i]>4)
			{
				cout<<"cheat"<<endl;
				goto end;
			}
		}
		for(int i=3;i<=13;i++)
		{
			if(poker[i]==4)
			{
				cout<<i<<endl;
				goto end;
			}
		}
		for(int i=2;i>=1;i--)
		{
			if(poker[i]==4)
			{
				cout<<i<<endl;
				goto end;
			}
		}
		cout<<"no bomb"<<endl;
		end:
		continue;
	}
	cin.close();
	cout.close();
	return 0;
}