# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
21112 | yunhoo90 | 마술 (GCJ14_magic) | C++11 | 0 ms | 2020 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |