# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
142499 | 2019-08-09T10:30:24 Z | KCSC | Kotrljanje (COCI18_kotrljanje) | C++14 | 2000 ms | 2940 KB |
#include <bits/stdc++.h> using namespace std; const int DIM = 50005; int frq[DIM]; int convert(long long x, int b) { int s = 0; for (; x; x /= b) s += x % b; return s; } int main(void) { // freopen("kotrljanje.in", "r", stdin); // freopen("kotrljanje.out", "w", stdout); int c, d, b, m; scanf("%d %d %d %d", &c, &d, &b, &m); long long aux = 1LL * c * (b - 1), aux1 = aux + d, aux2 = aux + d; for (int i = 1; i; i++, aux1 += aux) { int v = convert(aux1, b); ++frq[v]; if (frq[v] == m) { for (int j = 1; j <= i; ++j, aux2 += aux) if (convert(aux2, b) == v) printf("%lld ", 1LL * j * (b - 1)); break; } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 376 KB | Output is correct |
2 | Correct | 93 ms | 2940 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 70 ms | 2424 KB | Output is correct |
2 | Correct | 64 ms | 2424 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 63 ms | 2552 KB | Output is correct |
2 | Correct | 68 ms | 2552 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 71 ms | 2680 KB | Output is correct |
2 | Correct | 77 ms | 2680 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 72 ms | 2816 KB | Output is correct |
2 | Correct | 199 ms | 2276 KB | Output is correct |
3 | Correct | 101 ms | 2680 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 87 ms | 2808 KB | Output is correct |
2 | Correct | 73 ms | 2808 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 70 ms | 376 KB | Output is correct |
2 | Correct | 810 ms | 1152 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1815 ms | 1876 KB | Output is correct |
2 | Correct | 1196 ms | 2296 KB | Output is correct |
3 | Execution timed out | 2052 ms | 2024 KB | Time limit exceeded |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 177 ms | 2208 KB | Output is correct |
2 | Correct | 967 ms | 2180 KB | Output is correct |
3 | Correct | 90 ms | 2812 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 80 ms | 2808 KB | Output is correct |
2 | Correct | 76 ms | 2296 KB | Output is correct |