Submission #68313


ソースコード

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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <bits/stdc++.h>
#define lol long long
using namespace std;
int main(){
char c1, c2;
cin>>c1>>c2;
int n;
cin>>n;
int x, y;
char tet[5][3];
tet[0][0] = c1;
tet[1][0] = c2;
if(c1 == 'B'){
if(c2 == 'R'){
tet[2][0] = 'G';
tet[3][0] = 'Y';
tet[0][1] = 'Y';
tet[1][1] = 'G';
tet[2][1] = 'R';
tet[3][1] = 'B';
}else if(c2 == 'Y'){
tet[2][0] = 'R';
tet[3][0] = 'G';
tet[0][1] = 'G';
tet[1][1] = 'R';
tet[2][1] = 'Y';
tet[3][1] = 'B';
}else if(c2 == 'G'){
tet[2][0] = 'Y';
tet[3][0] = 'R';
tet[0][1] = 'R';
tet[1][1] = 'Y';
tet[2][1] = 'G';
tet[3][1] = 'B';
}
}else if(c1 == 'R'){
if(c2 == 'B'){
tet[2][0] = 'Y';
tet[3][0] = 'G';
tet[0][1] = 'G';
tet[1][1] = 'Y';
tet[2][1] = 'B';
tet[3][1] = 'R';
}else if(c2 == 'Y'){
tet[2][0] = 'G';
tet[3][0] = 'B';
tet[0][1] = 'B';
tet[1][1] = 'G';
tet[2][1] = 'Y';
tet[3][1] = 'R';
}else if(c2 == 'G'){
tet[2][0] = 'B';
tet[3][0] = 'Y';
tet[0][1] = 'Y';
tet[1][1] = 'B';
tet[2][1] = 'G';
tet[3][1] = 'R';
}
}else if(c1 == 'Y'){
if(c2 == 'B'){
tet[2][0] = 'G';
tet[3][0] = 'R';
tet[0][1] = 'R';
tet[1][1] = 'G';
tet[2][1] = 'B';
tet[3][1] = 'Y';
}else if(c2 == 'R'){
tet[2][0] = 'B';
tet[3][0] = 'G';
tet[0][1] = 'G';
tet[1][1] = 'B';
tet[2][1] = 'R';
tet[3][1] = 'Y';
}else if(c2 == 'G'){
tet[2][0] = 'R';
tet[3][0] = 'B';
tet[0][1] = 'B';
tet[1][1] = 'R';
tet[2][1] = 'G';
tet[3][1] = 'Y';
}
}else if(c1 == 'G'){
if(c2 == 'B'){
tet[2][0] = 'R';
tet[3][0] = 'Y';
tet[0][1] = 'Y';
tet[1][1] = 'R';
tet[2][1] = 'B';
tet[3][1] = 'G';
}else if(c2 == 'R'){
tet[2][0] = 'Y';
tet[3][0] = 'B';
tet[0][1] = 'B';
tet[1][1] = 'Y';
tet[2][1] = 'R';
tet[3][1] = 'G';
}else if(c2 == 'Y'){
tet[2][0] = 'B';
tet[3][0] = 'R';
tet[0][1] = 'R';
tet[1][1] = 'B';
tet[2][1] = 'Y';
tet[3][1] = 'G';
}
}
for(int i = 0; i < n; i++){
cin >> x >> y;
cout << tet[x % 4][y % 2] << "\n";
}
return 0;
}

ステータス

項目 データ
問題 1442 - テトラへドロン
ユーザー名 ei2038
投稿日時 2021-09-06 17:36:04
言語 C++17
状態 Accepted
得点 8
ソースコード長 2992 Byte
最大実行時間 51 ms
最大メモリ使用量 592 KB

セット

セット 得点 Cases
1 ALL 8 / 8 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in1 AC 51 ms 476 KB
1
in2 AC 24 ms 504 KB
1
in3 AC 20 ms 480 KB
1
in4 AC 19 ms 576 KB
1
in5 AC 20 ms 424 KB
1
in6 AC 21 ms 396 KB
1
in7 AC 21 ms 368 KB
1
in8 AC 19 ms 468 KB
1
in9 AC 21 ms 568 KB
1
in10 AC 19 ms 448 KB
1
in11 AC 19 ms 548 KB
1
in12 AC 19 ms 392 KB
1
in13 AC 20 ms 496 KB
1
in14 AC 19 ms 592 KB
1
in15 AC 18 ms 564 KB
1
in16 AC 21 ms 536 KB
1