#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>
#include<set>
using namespace std;
const int MAX = 54;
char Front(int n){
if(n / 13 == 0){
return 'S';
}
else if(n / 13 == 1){
return 'H';
}
else if(n / 13 == 2){
return 'C';
}
else if(n / 13 == 3){
return 'D';
}
else{
return 'J';
}
}
int main(){
int k;
int ch[MAX];//变换矩阵
int af[MAX];//变换后的矩阵
cin>>k;
for(int i = 0; i < MAX; i++){
cin>>ch[i];
ch[i]--;
}
for(int i = 0; i < MAX; i++){
int posi = i;
for(int j = 0; j < k; j++){
posi = ch[posi];
}
af[posi] = i;
}
for(int i = 0; i < MAX; i++){
if(i != 0) printf(" ");
printf("%c%d",Front(af[i]),af[i]%13 + 1);
}
return 0;
}
1042. Shuffling Machine (20)
最新推荐文章于 2021-02-21 21:00:17 发布