# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
142638 | Ruxandra985 | Kotrljanje (COCI18_kotrljanje) | C++14 | 1093 ms | 10488 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 <cstdio>
#include <vector>
using namespace std;
vector <int> v[50000];
int scf (long long x,int b){
int sol = 0;
while (x){
sol = sol + (x%b);
x/=b;
}
return sol;
}
int main()
{
// freopen ("a.in" , "r" , stdin);
// freopen ("a.out" , "w" , stdout);
int c,d,b,m,n,j,nr;
scanf ("%d%d%d%d",&c,&d,&b,&m);
for (n = 1; ; n += (b-1)){
nr = scf((long long)c * n + d , b);
v[nr].push_back(n);
if (v[nr].size() == m){
for (j=0;j<v[nr].size();j++)
printf ("%d ",v[nr][j]);
break;
}
}
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... |