# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
955535 | rainboy | Who wants to live forever? (CERC12_B) | C11 | 27 ms | 10452 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>
#include <string.h>
#define N 200000
int main() {
int t;
scanf("%d", &t);
while (t--) {
static char cc[N + 1];
int n, l, i, j, dies;
scanf("%s", cc), n = strlen(cc);
l = 0;
while ((n + 1 & 1 << l) == 0)
l++;
dies = 1;
for (i = (1 << l) - 1; i < n; i += 1 << l) {
if (cc[i] != '0') {
dies = 0;
break;
}
for (j = 1; j < 1 << l; j++)
if (cc[i - j] != cc[i + j]) {
dies = 0;
break;
}
}
printf(dies ? "DIES\n" : "LIVES\n");
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |