记录编号 488130 评测结果 AAAAAAAAAA
题目名称 打扑克 最终得分 100
用户昵称 Gravatar梦那边的美好ET 是否通过 通过
代码语言 C++ 运行时间 0.030 s
提交时间 2018-02-17 21:23:14 内存使用 0.25 MiB
显示代码纯文本
  1. #include<cstdio>
  2. #include<iostream>
  3. using namespace std;
  4. int a[14]={0};
  5. int m,n,b,c=0,d=0;
  6. int main(){
  7. freopen("poker1.in","r",stdin);
  8. freopen("poker1.out","w",stdout);
  9. cin>>m;
  10. for(int i=1;i<=m;i++){
  11. cin>>n;
  12. for(int j=1;j<=n;j++){
  13. cin>>b;
  14. a[b]+=1;}
  15. for(int j=1;j<=13;j++){
  16. if(a[j]>4){
  17. cout<<"cheat";
  18. c=1;
  19. break;}
  20. if(a[j]<4){
  21. d+=1;}}
  22. if(d==13){
  23. cout<<"no bomb";}
  24. if(d!=13&&c!=1){
  25. for(int j=3;j<=13;j++){
  26. if(a[j]==4){
  27. cout<<j;
  28. c=1;
  29. break;}}
  30. if(c==0){
  31. if(a[2]==4){
  32. cout<<"2";}
  33. else{
  34. cout<<"1";}}}
  35. c=0;
  36. d=0;
  37. cout<<endl;
  38. for(int j=1;j<=13;j++){
  39. a[j]=0;}}
  40. return 0;}
  41.  
  42.