| 比赛 | 
    NOIP2023模拟赛1 | 
    评测结果 | 
    AAAAAAAAAA | 
    | 题目名称 | 
    打扑克 | 
    最终得分 | 
    100 | 
    | 用户昵称 | 
    宇战 | 
    运行时间 | 
    0.000 s  | 
    | 代码语言 | 
    C++ | 
    内存使用 | 
    0.00 MiB  | 
    | 提交时间 | 
    2023-11-13 11:35:20 | 
显示代码纯文本
    #include<bits/stdc++.h>
    using namespace std;
    int n,m,a[10000],s,h[100];
    int u[14]={0,13,12,1,2,3,4,5,6,7,8,9,10,11};
    int uu[14]={0,3,4,5,6,7,8,9,10,11,12,13,2,1}; 
    int main(){
        freopen("poker1.in","r",stdin);
        freopen("poker1.out","w",stdout);
         cin>>m;
         s=14;
         for(int op=1;op<=m;op++){
             cin>>n;
             int ff=0;
             memset(h,0,sizeof(h));
             s=14;
             for(int i=1;i<=n;i++){
                 cin>>a[i];
                 h[a[i]]++;
                 if(h[a[i]]>4){
                     ff=1;
                 }else if(h[a[i]]==4){
                     s=min(s,u[a[i]]);
                 }
             }
             if(ff){
                 cout<<"cheat"<<endl;
             }else
             if(s==14){
                 cout<<"no bomb"<<endl;
             }else{
                 cout<<uu[s]<<endl;
             }
         }
    }