# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
143185 | bupjae | 마술 (GCJ14_magic) | C++17 | 3 ms | 504 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
void main2() {
int v, w;
int d[17]{};
cin >> v;
for (int i = 1; i <= 4; i++) {
for (int j = 4; j > 0; j--) {
cin >> w;
if (i == v) d[w]++;
}
}
cin >> v;
for (int i = 1; i <= 4; i++) {
for (int j = 4; j > 0; j--) {
cin >> w;
if (i == v) d[w]++;
}
}
v = 0;
for (int i = 16; i > 0; i--) {
if (d[i] == 2) {
if (v != 0) {
cout << "Bad magician!";
return;
}
v = i;
}
}
if (v == 0) {
cout << "Volunteer cheated!";
} else {
cout << v;
}
}
int main() {
int t;
cin >> t;
for (int i = 1; i <= t; i++) {
cout << "Case #" << i << ": ";
main2();
cout << "\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |