hdu 4930 Fighting the Landlords 多校第六场 斗地主纯模拟
来源:互联网 发布:导出来的sql带双引号 编辑:程序博客网 时间:2024/04/20 11:23
//0MS312K#include<stdio.h>#include<string.h>#include<algorithm>#include<vector>#include<iostream>#include<queue>#include<stack>#include<math.h>using namespace std;char a[25];char b[25];int pp(char k){ if(k=='T') return 10; else if(k=='J') return 11; else if(k=='Q') return 12; else if(k=='K') return 13; else if(k=='A') return 14; else if(k=='2') return 15; else if(k=='X') return 16; else if(k=='Y') return 17; else return k-'0';}int A[25];int B[25];int main(){ int t; scanf("%d",&t); while(t--){ scanf("%s",a); scanf("%s",b); int len=strlen(a); memset(A,0,sizeof(A)); memset(B,0,sizeof(B)); int dz=0; int zhadan=0; int dui=0; int san=0; int dz1=0; int zhadan1=0; int dui1=0; int san1=0; int z=0; int d=0; int s=0; int zd=0; bool flag=0; for(int i=0;i<len;i++){ a[i]=pp(a[i]); A[a[i]]++; if(A[a[i]]==1){ dz1=max(dz1,(int)a[i]); z++; } else if(A[a[i]]==2){ dui1=max(dui1,(int)a[i]); d++; } else if(A[a[i]]==3){ san1=max(san1,(int)a[i]); s++; } else if(A[a[i]]==4){ zhadan1=max(zhadan1,(int)a[i]); zd++; } } //cout<<z<<" "<<d<<" "<<s<<" "<<zd<<endl; if(s==1&&zd==0){ if(z==2&&d==1) flag=1; else if(z==2&&d==2) flag=1; } else if(s==1&&zd==1){ if(z==3&&d==1) flag=1; else if(z==2&&d==2) flag=1; //cout<<z<<" "<<d<<" "<<zd<<endl; } else if(s==0&&zd==0){ if(z==1&&d==0) flag=1; else if(d==1&&z==1) flag=1; } if(flag==1){ printf("Yes\n"); continue; } int len1=strlen(b); for(int i=0;i<len1;i++){ b[i]=pp(b[i]); B[b[i]]++; if(B[b[i]]==1) dz=max(dz,(int)b[i]); if(B[b[i]]==2){ dui=max(dui,(int)b[i]); } if(B[b[i]]==3){ san=max(san,(int)b[i]); } if(B[b[i]]==4){ zhadan=max(zhadan,(int)b[i]); } } if(B[16]==1&&B[17]==1){ printf("No\n"); continue; } if(A[16]==1&&A[17]==1){ printf("Yes\n"); continue; } if(zhadan&&zhadan1){ if(zhadan1>zhadan){ printf("Yes\n"); continue; } else{ printf("No\n"); continue; } } else if(zhadan){ printf("No\n"); continue; } else if(zhadan1){ printf("Yes\n"); continue; } else{ bool flag1=0; if(san&&san1){ if(san1>san) flag1=1; } else if(san1) flag=1; if(dui&&dui1){ if(dui1>dui) flag1=1; } else if(dui1) flag1=1; if(dz1>dz) flag1=1; if(flag1==1) printf("Yes\n"); else printf("No\n"); } }}
0 0
- hdu 4930 Fighting the Landlords 多校第六场 斗地主纯模拟
- HDU 4930 Fighting the Landlords 斗地主模拟
- HDU 4930 Fighting the Landlords 多校第六场
- hdu 4930 Fighting the Landlords 多校第六场 大模拟
- HDU-4930 Fighting the Landlords 多校训练赛斗地主
- hdu 4930 Fighting the Landlords(模拟)
- hdu 4930 Fighting the Landlords (模拟)
- HDU 4930 Fighting the Landlords 模拟
- HDU 4930-Fighting the Landlords(模拟)
- Hdu 4930 Fighting the Landlords 简单模拟
- hdu 4930 Fighting the Landlords (模拟)
- HDU 4930 Fighting the Landlords 模拟
- HDU 4930 : Fighting the Landlords(模拟)
- hdu 4930 Fighting the Landlords(模拟)
- HDU 4930 Fighting the Landlords --多Trick,较复杂模拟
- hdu 4930 Fighting the Landlords
- hdu 4930 Fighting the Landlords
- Fighting the Landlords HDU - 4930
- C/C++中static关键字详解
- hdoj.1995 汉诺塔V 20140808
- 实现按钮式单选
- VC2013 ArcGIS Engine 10.0开发环境搭建
- 网络故障排查
- hdu 4930 Fighting the Landlords 多校第六场 斗地主纯模拟
- 【算法导论学习-008】算法时间复杂度的计算
- LinearLayout中layout_gravity控制控件位置
- dump_stack 和 trigger_all_cpu_backtrace
- [Linux]常用命令
- c++ Constructor FAQ 续
- 从HTML代码中提取文字,去掉HTML的标记
- 负载均衡(LB)详解
- 最大流-Edmonds-Karp算法