# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
142502 | 2019-08-09T10:35:06 Z | KCSC | Kotrljanje (COCI18_kotrljanje) | C++14 | 1120 ms | 10452 KB |
#include <bits/stdc++.h> using namespace std; const int DIM = 50005; int frq[DIM]; vector<int> lst[DIM]; int _b; int convert(long long x) { 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; _b = b; for (int i = 1; i; i++, aux1 += aux) { int v = convert(aux1); ++frq[v]; lst[v].push_back(i); if (frq[v] == m) { for (int x : lst[v]) printf("%lld ", 1LL * x * (b - 1)); break; } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 1656 KB | Output is correct |
2 | Correct | 77 ms | 6216 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 57 ms | 5056 KB | Output is correct |
2 | Correct | 52 ms | 5224 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 53 ms | 4996 KB | Output is correct |
2 | Correct | 57 ms | 5484 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 60 ms | 5540 KB | Output is correct |
2 | Correct | 63 ms | 5496 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 58 ms | 5608 KB | Output is correct |
2 | Correct | 133 ms | 5616 KB | Output is correct |
3 | Correct | 75 ms | 5668 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 70 ms | 5852 KB | Output is correct |
2 | Correct | 59 ms | 5612 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 39 ms | 2044 KB | Output is correct |
2 | Correct | 424 ms | 5304 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 979 ms | 9564 KB | Output is correct |
2 | Correct | 650 ms | 10452 KB | Output is correct |
3 | Correct | 1120 ms | 10428 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 114 ms | 6108 KB | Output is correct |
2 | Correct | 523 ms | 8804 KB | Output is correct |
3 | Correct | 69 ms | 5992 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 64 ms | 5600 KB | Output is correct |
2 | Correct | 58 ms | 4968 KB | Output is correct |