# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
473628 | rainboy | Kotrljanje (COCI18_kotrljanje) | C11 | 905 ms | 2828 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |