记录编号 |
584490 |
评测结果 |
AAAAAAAAAA |
题目名称 |
打扑克 |
最终得分 |
100 |
用户昵称 |
yuanna |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.000 s |
提交时间 |
2023-11-13 14:30:23 |
内存使用 |
0.00 MiB |
显示代码纯文本
#include <iostream>
using namespace std;
int main()
{
freopen("poker1.in","r",stdin);
freopen("poker1.out","w",stdout);
int M,N,i=1,j=1,a[110][14]={},b,min;
string c[14]={"0","1","2","13","12","11","10","9","8","7","6","5","4","3"};
cin>>M;
while(i<=M)
{
cin>>N;
j=1;
while(j<=N)
{
cin>>b;
if(b==1)
a[i][1]=a[i][1]+1;else
if(b==2)
a[i][2]=a[i][2]+1;else
if(b==13)
a[i][3]=a[i][3]+1;else
if(b==12)
a[i][4]=a[i][4]+1;else
if(b==11)
a[i][5]=a[i][5]+1;else
if(b==10)
a[i][6]=a[i][6]+1;else
if(b==9)
a[i][7]=a[i][7]+1;else
if(b==8)
a[i][8]=a[i][8]+1;else
if(b==7)
a[i][9]=a[i][9]+1;else
if(b==6)
a[i][10]=a[i][10]+1;else
if(b==5)
a[i][11]=a[i][11]+1;else
if(b==4)
a[i][12]=a[i][12]+1;else
if(b==3)
a[i][13]=a[i][13]+1;
j=j+1;
}
i=i+1;
}
i=1;j=1;
while(i<=M)
{
j=1;
min=0;
while(j<=13)
{
if(a[i][j]==4&&j>min)
min=j;
if(a[i][j]>4)
{
cout<<"cheat"<<endl;
break;
}
j=j+1;
if(j==14)
{
if(min==0)
cout<<"no bomb"<<endl;
else
cout<<c[min]<<endl;
}
}
i=i+1;
}
return 0;
}