so,why RE?
查看原帖
so,why RE?
901512
liyuhongtiga楼主2024/10/26 16:47
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,a[55],b[55],vis[55][55],ans;
int zh(string x,int i){
	if(x[0]=='D'){
		a[i]=1;
	}
	if(x[0]=='C'){
		a[i]=2;
	}
	if(x[0]=='H'){
		a[i]=3;
	}
	if(x[0]=='S'){
		a[i]=4;
	}
	if(x[1]=='A'){
		b[i]=1;
	}
	if(x[1]>='0'&&x[1]<='9'){
		b[i]=x[1]-'0';
	}
	if(x[1]=='T'){
		b[i]=10;
	}
	if(x[1]=='J'){
		b[i]=11;
	}
	if(x[1]=='Q'){
		b[i]=12;
	}
	if(x[1]=='K'){
		b[i]=13;
	}
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++){
		string x;
		cin>>x;
		zh(x,i);
		if(vis[a[i]][b[i]]==0){
			ans++;
		}
		vis[a[i]][b[i]]=1;
	}
	cout<<52-ans;
	return 0;
}

2024/10/26 16:47
加载中...