Submission #483287

#TimeUsernameProblemLanguageResultExecution timeMemory
483287rainboyVlak (COCI20_vlak)C11
70 / 70
10 ms9804 KiB
#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 (stderr)

Main.c: In function 'main':
Main.c:24:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
Main.c:30:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |   scanf("%s", cc), l = strlen(cc);
      |   ^~~~~~~~~~~~~~~
Main.c:40:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   40 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
Main.c:45:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |   scanf("%s", cc), l = strlen(cc);
      |   ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...