-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpticalreader.cpp
More file actions
75 lines (68 loc) · 2.17 KB
/
Copy pathOpticalreader.cpp
File metadata and controls
75 lines (68 loc) · 2.17 KB
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
#include <bits/stdc++.h>
using namespace std;
#define fastIO cin.tie(0); cout.tie(0);
#define endl '\n'
#define FO(i, b) for (int i = 0; i < (b); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rFOR(i, a, b) for (int i = (a); i > (b); i--)
#define TR(v, arr) for(auto& (v) : (arr))
#define pint(x) printf("%d\n", x);
#define pll(x) printf("%lld\n", x);
#define si(x) scanf("%d", &x);
#define sl(x) scanf("%lld", &x);
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
void setIO() {
string file = __FILE__;
file = string(file.begin(), file.end()-3);
string input_file = file + "in";
string output_file = file + "out";
freopen(input_file.c_str(), "r", stdin);
freopen(output_file.c_str(), "w", stdout);
}
// -----------------------------------------------------------------------------
// Here begins our solution
// -----------------------------------------------------------------------------
void solve() {
int question;
while(scanf("%d", &question)>0){
vector<char> insc = {'A','B','C','D','E'};
while(question--){
int black=0; int white=0;
char chas = 'v';
for(int i=0; i<5; i++){
int ans;
si(ans);
if(ans <= 127 && black == 0){
chas = insc[i];
black++;
}else if(ans >127){
white++;
}else if(black>=1 && chas != 'v'){
black++;
}else{
white++;
}
}
if(black>1){
printf("*\n");
}else if(white == 5){
printf("*\n");
}else{
printf("%c\n",chas);
}
}
}
}
int main() {
if (getenv("CP_IO")) { setIO(); }
int T=1;
FO(tc, T){
solve();
}
return 0;
}