新手表示不会map,只能这样
码风较丑,请大佬不要喷
#include<bits/stdc++.h>
using namespace std;
int cnt[300+5];
int d[15];
int main() {
int n,ans=0;
string s;
cin>>n;
for(int i=1; i<=10; i++) {
d[i]=0;
}
for(int i=1; i<=n; i++) {
cin>>s;
if(s[1]=='A') {
s[1]=1;
} else if(s[1]=='T') {
s[1]=10;
} else if(s[1]=='J') {
s[1]=11;
} else if(s[1]=='Q') {
s[1]=12;
} else if(s[1]=='K') {
s[1]=13;
}
int d=(int)s[0];
int h=(int)s[1];
cnt[d-h]++;
}
if(n==1) {
cout<<"51";
return 0;
}
for(int i=1; i<=305; i++) {
if(cnt[i]>=1) {
ans++;
}
}
for(int i=1; i<=10; i++) {
if(d[i]>=1) {
ans++;
}
}
cout<<52-ans;
return 0;
}
_10分,自己出的样例也能过,呜呜呜呜呜呜呜 _