# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
8211 | gs14004 | 마술 (GCJ14_magic) | C++98 | 0 ms | 1208 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 <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int tc,i;
void process(){
int c1,c2,t,cnt = 0, val;
scanf("%d",&c1);
vector<int> v;
for (int i=0; i<4; i++) {
for (int j=0; j<4; j++) {
scanf("%d",&t);
if(i+1 == c1) v.push_back(t);
}
}
scanf("%d",&c2);
for (int i=0; i<4; i++) {
for (int j=0; j<4; j++) {
scanf("%d",&t);
if(i+1 == c2 && find(v.begin(),v.end(),t) != v.end()){
cnt++;
val = t;
}
}
}
printf("Case %d: ",i+1);
if(cnt == 0) puts("Volunteer cheated!");
else if(cnt > 1) puts("Bad magician!");
else printf("%d\n",val);
}
int main(){
scanf("%d",&tc);
for (i=0; i<tc; i++) {
process();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |