# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
141175 | mariusnicoli | Kotrljanje (COCI18_kotrljanje) | C++14 | 1833 ms | 65540 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 <iostream>
#include <vector>
#include <map>
using namespace std;
map<int, vector<long long>> mp;
long long c, d, b, m, p, i, n, suma;
int main () {
cin>>c>>d>>b>>m;
p = 1;
while (p <= d)
p*=b;
for (i=1;;i++) {
n = 1LL*c*i*p+d;
suma = 0;
while (n) {
suma += n%b;
n/=b;
}
///if (mp.find(suma) == mp.end()) {
mp[suma].push_back(i*p);
if (mp[suma].size() == m) {
for (int i=0;i<mp[suma].size();i++)
cout<<mp[suma][i]<<" ";
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... |