# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145058 | Linca_Robert | Kotrljanje (COCI18_kotrljanje) | C++14 | 1106 ms | 18648 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<bits/stdc++.h>
using namespace std;
const int DIM = 1e5;
int C, D, B, M;
long long curr, aux;
vector<long long> arr[DIM];
inline int suma( long long x ){
int s = 0;
while( x != 0 ){
s += x % B;
x /= B;
}
return s;
}
int main(){
cin >> C >> D >> B >> M;
aux = 1LL * C * (B - 1);
curr = aux + D;
for( int i = 1; ; i++ ){
int s = suma( curr );
arr[s].push_back( i );
if( arr[s].size() == M ){
for( int j = 0; j < arr[s].size(); j++ )
cout << 1LL * arr[s][j] * (B - 1) << " ";
break;
}
curr += aux;
}
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... |