# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
483287 | rainboy | Vlak (COCI20_vlak) | C11 | 10 ms | 9804 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |