# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
483287 | 2021-10-28T13:27:29 Z | rainboy | Vlak (COCI20_vlak) | C | 10 ms | 9804 KB |
#include <stdio.h> #include <string.h> #define N_ 200002 #define A 26 int tt[N_][A]; char msk[N_]; int dfs(int i, int t) { int a; for (a = 0; a < A; a++) { int j = tt[i][a]; if ((msk[j] & 1 << t) != 0 && !dfs(j, t ^ 1)) return 1; } return 0; } int main() { int n, n_; scanf("%d", &n); n_ = 2; while (n--) { static char cc[N_]; int l, h, i; scanf("%s", cc), l = strlen(cc); for (h = 0, i = 1; h < l; h++) { int a = cc[h] - 'a'; if (!tt[i][a]) tt[i][a] = n_++; i = tt[i][a]; msk[i] |= 1; } } scanf("%d", &n); while (n--) { static char cc[N_]; int l, h, i; scanf("%s", cc), l = strlen(cc); for (h = 0, i = 1; h < l; h++) { int a = cc[h] - 'a'; if (!tt[i][a]) tt[i][a] = n_++; i = tt[i][a]; msk[i] |= 2; } } printf(dfs(1, 0) ? "Nina\n" : "Emilija\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 332 KB | Output is correct |
2 | Correct | 0 ms | 332 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 412 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 0 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 0 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 332 KB | Output is correct |
2 | Correct | 0 ms | 332 KB | Output is correct |
3 | Correct | 0 ms | 332 KB | Output is correct |
4 | Correct | 0 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 10 ms | 9164 KB | Output is correct |
2 | Correct | 8 ms | 8652 KB | Output is correct |
3 | Correct | 8 ms | 8104 KB | Output is correct |
4 | Correct | 8 ms | 8908 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 9436 KB | Output is correct |
2 | Correct | 8 ms | 9804 KB | Output is correct |
3 | Correct | 8 ms | 9036 KB | Output is correct |
4 | Correct | 8 ms | 9164 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 8848 KB | Output is correct |
2 | Correct | 8 ms | 8652 KB | Output is correct |
3 | Correct | 8 ms | 8944 KB | Output is correct |
4 | Correct | 8 ms | 9420 KB | Output is correct |