Submission #473628

#TimeUsernameProblemLanguageResultExecution timeMemory
473628rainboyKotrljanje (COCI18_kotrljanje)C11
140 / 140
905 ms2828 KiB
#include <stdio.h> #define B 5000 #define L 64 int sum(long long a, int b) { return a == 0 ? 0 : sum(a / b, b) + a % b; } int main() { static int kk[L]; int c, d, b, m, s; long long i; scanf("%d%d%d%d", &c, &d, &b, &m); for (i = b - 1; ; i += b - 1) if (++kk[s = sum(i * c + d, b) / (b - 1)] == m) break; while (i > 0) { if (sum(i * c + d, b) / (b - 1) == s) printf("%lld ", i); i -= b - 1; } printf("\n"); return 0; }

Compilation message (stderr)

kotrljanje.c: In function 'main':
kotrljanje.c:15:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |  scanf("%d%d%d%d", &c, &d, &b, &m);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...