Submission #940810

#TimeUsernameProblemLanguageResultExecution timeMemory
940810rainboy관대한 주인 (TOKI14_generous)C11
100 / 100
6 ms420 KiB
#include <stdio.h> long long power(long long a, int k, int md) { long long p = 1; a %= md; while (k) { if (k & 1) p = p * a % md; a = a * a % md; k >>= 1; } return p; } int main() { int a, b, l, r; scanf("%d%d%d%d", &a, &b, &l, &r); a = a % b * power(10, l - 1, b) % b; while (l <= r) printf("%lld", (long long) a * 10 / b), a = (long long) a * 10 % b, l++; printf("\n"); return 0; }

Compilation message (stderr)

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