Submission #448530

#TimeUsernameProblemLanguageResultExecution timeMemory
448530rainboyKartomat (COCI17_kartomat)C11
80 / 80
1 ms332 KiB
#include <stdio.h> #include <string.h> #define N 50 #define L 100 #define A 26 #define N_ (2 + N * L) int tt[N_][A]; int main() { static char cc[L + 1], keyboard[4][16]; int n, n_, l, i, s, a; scanf("%d", &n); n_ = 2; while (n--) { scanf("%s", cc), l = strlen(cc); for (i = 0, s = 1; i < l; i++) { a = cc[i] - 'A'; if (!tt[s][a]) tt[s][a] = n_++; s = tt[s][a]; } } scanf("%s", cc), l = strlen(cc); for (i = 0, s = 1; i < l; i++) s = tt[s][cc[i] - 'A']; keyboard[0][0] = keyboard[0][1] = keyboard[0][2] = '*'; for (a = 0; a < A; a++) keyboard[(a + 3) / 8][(a + 3) % 8] = tt[s][a] ? a + 'A' : '*'; keyboard[3][5] = keyboard[3][6] = keyboard[3][7] = '*'; for (i = 0; i < 4; i++) printf("%s\n", keyboard[i]); return 0; }

Compilation message (stderr)

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