# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
8220 |
2014-09-07T06:08:07 Z |
ansol4328 |
마술 (GCJ14_magic) |
C++ |
|
0 ms |
1088 KB |
#include<stdio.h>
int main()
{
int i, j, k, n, a, m[6][6], cnt, out;
int list[4][6];
scanf("%d",&n);
for(k=1 ; k<=n ; k++)
{
cnt=0;
scanf("%d",&a);
for(i=1 ; i<=4 ; i++)
{
for(j=1 ; j<=4 ; j++)
{
scanf("%d",&m[i][j]);
if(i==a) list[1][j]=m[i][j];
}
}
scanf("%d",&a);
for(i=1 ; i<=4 ; i++)
{
for(j=1 ; j<=4 ; j++)
{
scanf("%d",&m[i][j]);
if(i==a) list[2][j]=m[i][j];
}
}
for(i=1 ; i<=4 ; i++) for(j=1 ; j<=4 ; j++) if(list[1][i]==list[2][j]) out=list[1][i], cnt++;
if(cnt==0) printf("case #%d: Volunteer cheated!\n",i);
if(cnt==1) printf("case #%d: %d\n",i,out);
if(cnt>=2) printf("case #%d: Bad magician!\n",i);
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |