# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
940786 | rainboy | 마술 (GCJ14_magic) | C11 | 1 ms | 424 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>
#define N 4
int main() {
int t, _;
scanf("%d", &t);
for (_ = 1; _ <= t; _++) {
int i, i_, j, a, b1, b2, b;
scanf("%d", &i_), i_--;
b1 = 0;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++) {
scanf("%d", &a);
if (i == i_)
b1 |= 1 << a;
}
scanf("%d", &i_), i_--;
b2 = 0;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++) {
scanf("%d", &a);
if (i == i_)
b2 |= 1 << a;
}
b = b1 & b2;
printf("Case #%d: ", _);
if (b == 0)
printf("Volunteer cheated!\n");
else if ((b & b - 1) != 0)
printf("Bad magician!\n");
else {
a = 1;
while (1 << a != b)
a++;
printf("%d\n", a);
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |