比赛 NOIP水题争霸赛 评测结果 AAAAAAAAAA
题目名称 打扑克 最终得分 100
用户昵称 Tony 运行时间 0.009 s
代码语言 C++ 内存使用 0.29 MiB
提交时间 2018-02-11 19:11:49
显示代码纯文本
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<queue>
#define ll long long
using namespace std;
ll RD(){
	ll flag = 1,out = 0;char c = getchar();
	while(c < '0' || c > '9'){if(c == '-')flag = -1;c = getchar();}
	while(c >= '0' && c <= '9'){out = out * 10 + c - '0';c = getchar();}
	return flag * out;
	}
const int maxn = 1010;
int T,num;
int pai[maxn];
int main(){
	freopen("poker1.in","r",stdin);
	freopen("poker1.out","w",stdout);
	T = RD();
	while(T--){
		num = RD();
		memset(pai,0,sizeof(pai));
		int c;
		for(int i = 1;i <= num;i++){
			cin>>c;
			if(c >= 3 && c <= 13)pai[c]++;
			else{
				if(c == 2)pai[14]++;
				else if(c == 1)pai[15]++;
				}
			}
		bool flag = 0;
		for(int i = 3;i <= 15;i++){
			if(pai[i] > 4){
				cout<<"cheat"<<endl;
				flag = 1;
				break;
				}
			}
		if(flag == 1)continue;
		for(int i = 3;i <= 13;i++){
			if(pai[i] == 4){
				cout<<i<<endl;
				flag = 1;
				break;
				}
			}
		if(flag == 1)continue;
		if(pai[14] == 4){
			cout<<2<<endl;
			flag = 1;
			}
		if(flag == 1)continue;
		if(pai[15] == 4){
			cout<<1<<endl;
			flag = 1;
			}
		if(flag == 1)continue;
		cout<<"no bomb"<<endl;
		}
	fclose(stdin);
	fclose(stdout);
	return 0;
	}