各位好友,在洛谷月赛中提交下图代码,
#include <bits/stdc++.h>
using namespace std;
char poker[17][10000];
int t,kingbomb,p[18],bomb;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> t;
for(int i = 0; n < 17; n ++)
for(int j = 0; j < t; j ++)
cin >> poker[i][j];
for(int j = 0; j < t; j ++)
{
for(int i = 0; n < 17; n ++)
{
if(poker[j][i] == 'X' || poker[j][i] == 'D')
kingbomb ++;
else
{
if(poker[j][i] == 'A') p[1] ++;
else if(poker[j][i] == 'T') p[10] ++;
else if(poker[j][i] == 'J') p[11] ++;
else if(poker[j][i] == 'Q') p[12] ++;
else if(poker[j][i] == 'K') p[13] ++;
else
{
int temp = poker[j][i] - '0';
p[temp] ++;
}
while(l<=17)
{
if(p[l] == 4)
{
bomb = 1;
break;
}
l++;
}
}
if(kingbomb == 2 || bomb == 0)
cout << "Yes\n";
else cout << "No\n";
}
return 0;
}