比赛 |
NOIP水题争霸赛 |
评测结果 |
C |
题目名称 |
打扑克 |
最终得分 |
0 |
用户昵称 |
fall in you |
运行时间 |
0.000 s |
代码语言 |
C++ |
内存使用 |
0.00 MiB |
提交时间 |
2018-02-11 21:34:43 |
显示代码纯文本
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
int n,m;
int a[25],cnt[25];
int main()
{
freopen("poker1.in","r",stdin);
freopen("poker1.out","w",stdout);
scanf("%d",&m);
while(m--){
scanf("%d",&n);
memset(cnt,0,sizeof(cnt));
int tmp1 = 0,tmp2 = 0,tmp3 = 0;
for(int i = 1; i <= n; i++){
scanf("%d",&a[i]);
cnt[a[i]] ++;
if(cnt[a[i]] > 4) tmp1 = 1;
}
if(tmp1 == 1) {printf("cheat\n");continue;}
for(int i = 3; i <= 13; i++) if(cnt[i] == 4) {printf("%d\n",i);tmp2 = 1;tmp3 = 1;break;}
if(tmp3) continue;
if(cnt[2] == 4) {printf("2\n");continue;}
if(cnt[1] == 4) {printf("1\n");continue;}
if(!tmp2) {printf("no bomb\n");continue;}
}
return 0;
}