# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
652310 | 2022-10-22T04:46:09 Z | Genius3435 | Kotrljanje (COCI18_kotrljanje) | C++17 | 422 ms | 16748 KB |
#include <bits/stdc++.h> using namespace std; using ll = long long; int constexpr DS = 32768; vector<ll> vals[DS]; int B; int ds(ll n) { int s = 0; while (n) s += n%B, n /= B; return s; } int main() { int C, D, M; cin >> C >> D >> B >> M; int mx_cnt = 0, mxi = -1; for (ll n = 1; mx_cnt < M; n += B-1) { int s = ds(C*n+D); vals[s].push_back(n); if (vals[s].size() > mx_cnt) { mx_cnt = vals[s].size(); mxi = s; } } for (ll const n : vals[mxi]) { cout << n << ' '; } cout << '\n'; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 1108 KB | Output is correct |
2 | Correct | 42 ms | 7632 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 35 ms | 6472 KB | Output is correct |
2 | Correct | 30 ms | 5652 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 35 ms | 6396 KB | Output is correct |
2 | Correct | 36 ms | 6668 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 33 ms | 6108 KB | Output is correct |
2 | Correct | 32 ms | 6324 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 40 ms | 6404 KB | Output is correct |
2 | Correct | 57 ms | 7692 KB | Output is correct |
3 | Correct | 42 ms | 7228 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 35 ms | 7016 KB | Output is correct |
2 | Correct | 41 ms | 7180 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 15 ms | 1876 KB | Output is correct |
2 | Correct | 168 ms | 7608 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 374 ms | 14992 KB | Output is correct |
2 | Correct | 233 ms | 16736 KB | Output is correct |
3 | Correct | 422 ms | 16748 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 50 ms | 9140 KB | Output is correct |
2 | Correct | 215 ms | 13288 KB | Output is correct |
3 | Correct | 38 ms | 7048 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 36 ms | 7012 KB | Output is correct |
2 | Correct | 36 ms | 6092 KB | Output is correct |