Submission #441658

#TimeUsernameProblemLanguageResultExecution timeMemory
441658rainboyTavan (COCI16_tavan)C11
80 / 80
1 ms284 KiB
#include <stdio.h> #include <string.h> #define N 500 #define A 26 int main() { static char cc[N + 1], ok[N][A]; int n, m, k, x, l, g, h, i, a; scanf("%d%d%d%d%s", &n, &m, &k, &x, cc), x--; for (h = 0; h < m; h++) { static char s[A + 1]; scanf("%s", s), l = strlen(s); for (g = 0; g < l; g++) ok[h][s[g] - 'a'] = 1; } for (i = n - 1, h = m - 1; i >= 0; i--) if (cc[i] == '#') { int d = x % k; for (a = 0; a < A; a++) if (ok[h][a] && d-- == 0) { cc[i] = a + 'a'; break; } x /= k, h--; } printf("%s\n", cc); return 0; }

Compilation message (stderr)

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