-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1042.cpp
More file actions
39 lines (36 loc) · 761 Bytes
/
1042.cpp
File metadata and controls
39 lines (36 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// 1042.cpp
// 算法
//
// Created by 王怡凡 on 17/2/28.
// Copyright © 2017年 王怡凡. All rights reserved.
//
#include<cstdio>
using namespace std;
const int maxn = 55;
int start[maxn],end[maxn],scan[maxn];
char A[6] = {"SHCDJ"};
int main() {
int repeat,i,j;
scanf("%d",&repeat);
for(i=1;i<maxn;i++) {
end[i] = i;
scanf("%d",&scan[i]);
}
for(i=0;i<repeat;i++) {
for(j=1;j<maxn;j++) {
start[j] = end[j];
}
for(j=1;j<maxn;j++) {
end[scan[j]] = start[j];
}
}
for(i=1;i<maxn;i++) {
end[i] = end[i]-1;
printf("%c%d", A[end[i]/13], end[i]%13+1);
if(i!=maxn-1) {
printf(" ");
}
}
return 0;
}