# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
14619 | ioojh6654 | 마술 (GCJ14_magic) | C++98 | 0 ms | 1084 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<stdio.h>
int main()
{
int i, j, k, n, a, m[6][6], cnt, out;
int l[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) l[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) l[2][j]=m[i][j];
}
}
for(i=1 ; i<=4 ; i++) for(j=1 ; j<=4 ; j++) if(l[1][i]==l[2][j]) out=l[1][i], cnt++;
if(cnt==0) printf("Case #%d: Volunteer cheated!\n",k);
if(cnt==1) printf("Case #%d: %d\n",k,out);
if(cnt>=2) printf("Case #%d: Bad magician!\n",k);
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |