UVa11210 中国麻将 Chinese Mahjong-搜索

https://vjudge.net/problem/UVA-11210

//被水题虐了一上午...

 #include<iostream>
 #include<cstdio>
 #include<cstring>
 using namespace std;
 const char* mahjong[]={"GZH","1T","2T","3T","4T","5T","6T","7T","8T","9T",
     "1S","2S","3S","4S","5S","6S","7S","8S","9S",
     "1W","2W","3W","4W","5W","6W","7W","8W","9W",
     "DONG","NAN","XI","BEI","ZHONG","FA","BAI"};
 ],startMahjong[];//last mahjong
 ];
 int ID(char* s){
     ;i<=;i++)
         ) return i;
     ;
 }
 bool dfs(int l){
     ) return true;
     ;i<=;i++){
         ){
             c[i]-=;
             )) return true;
             c[i]+=;
         }
     }
     ;i<=;i++)
         <=&&i%&&c[i]>=&&c[i+]>=&&c[i+]>=){
             --c[i];--c[i+];--c[i+];
             )) return true;
             ++c[i];++c[i+];++c[i+];
         }
     return false;
 }
 bool Judge(){
     ;i<=;i++){
         ){
             c[i]-=;
             )) return true;
             c[i]+=;
         }
     }
     return false;
 }
 int main()
 {
     ;
     ){
         ]==;
         printf("Case %d:",++caseCount);
         startMahjong[]=ID(input);
         ;i<=;i++){
             scanf("%s",input);startMahjong[i]=ID(input);
         }
         ;
         ;i<=;i++){
             memset(c,,sizeof(c));
             ;j<=;j++) c[startMahjong[j]]++;
             ) continue;
             c[i]++;
             if(Judge()){
                 ok=;
                 printf(" %s",mahjong[i]);
             }
             c[i]--;
         }
         if(!ok) printf(" Not ready");
         printf("\n");
     }
 }
上一篇:Django之集合函数使用与mysql表的创建特殊字段分析


下一篇:.NET CORE 2.0之 依赖注入在类中获取IHostingEnvironment,HttpContext