Submission #922636

#TimeUsernameProblemLanguageResultExecution timeMemory
922636rainboyOnes (LMIO17_vienetai)C11
81 / 100
1061 ms600 KiB
#include <stdio.h> int main() { int n, m, d, i, r, sum; scanf("%d%d%d", &n, &m, &d); if (n % m != 0) { printf("NESIDALO\n"); return 0; } r = 0, sum = 0; for (i = 0; i < n; i++) { r = r * 10 + (i % m == m - 1 ? 1 : 0); sum += r / d, r %= d; } if (r != 0) printf("NESIDALO\n"); else printf("%d\n", sum); return 0; }

Compilation message (stderr)

vienetai.c: In function 'main':
vienetai.c:6:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d%d%d", &n, &m, &d);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...