Submission #810549

#TimeUsernameProblemLanguageResultExecution timeMemory
810549rainboyBliskost (COI23_bliskost)C11
100 / 100
182 ms15868 KiB
#include <stdio.h> #define N 1000000 int main() { static char aa[N + 1], bb[N + 1]; int n, q, i, d; scanf("%d%d%s%s", &n, &q, aa, bb); if (n == 1) { printf(aa[0] == bb[0] ? "da\n" : "ne\n"); while (q--) { static char s[2]; scanf("%d%s", &i, s), i--; aa[i] = s[0]; printf(aa[0] == bb[0] ? "da\n" : "ne\n"); } } else { d = 0; for (i = 0; i < n; i++) d = (d + (aa[i] - 'a') * (i % 2 == 0 ? 1 : -1)) % 26; for (i = 0; i < n; i++) d = (d - (bb[i] - 'a') * (i % 2 == 0 ? 1 : -1)) % 26; printf(d == 0 ? "da\n" : "ne\n"); while (q--) { static char s[2]; scanf("%d%s", &i, s), i--; d = (d - (aa[i] - 'a') * (i % 2 == 0 ? 1 : -1)) % 26; aa[i] = s[0]; d = (d + (aa[i] - 'a') * (i % 2 == 0 ? 1 : -1)) % 26; printf(d == 0 ? "da\n" : "ne\n"); } } return 0; }

Compilation message (stderr)

Main.c: In function 'main':
Main.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d%d%s%s", &n, &q, aa, bb);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.c:15:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |    scanf("%d%s", &i, s), i--;
      |    ^~~~~~~~~~~~~~~~~~~~
Main.c:29:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |    scanf("%d%s", &i, s), i--;
      |    ^~~~~~~~~~~~~~~~~~~~
#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...