# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
21112 | yunhoo90 | 마술 (GCJ14_magic) | C++11 | 0 ms | 2020 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>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <list>
#include <memory.h>
using namespace std;
int map[4][4];
int row[4];
void input() {
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++)
cin >> map[i][j];
}
}
int main() {
int tc;
cin >> tc;
for(int cas = 1;cas <=tc; cas++) {
int cnt = 0;
int ans;
int r;
cin >> r;
input();
for (int i = 0; i < 4; i++)
row[i] = map[r - 1][i];
cin >> r;
input();
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (map[r - 1][i] == row[j]) {
ans = map[r - 1][i];
cnt++;
}
}
}
printf("Case #%d: ", cas);
switch (cnt)
{
case 0:
cout << "Volunteer cheated!" << endl;
break;
case 1:
cout << ans << endl;
break;
default:
cout << "Bad magician!" << endl;
break;
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |