# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
144217 | 2019-08-16T10:04:35 Z | AldeaDanut | Kotrljanje (COCI18_kotrljanje) | C++14 | 2000 ms | 3696 KB |
#include <iostream> #include <vector> using namespace std; long long n,c,d,b,m,x,i,sum,sol; int f[30000]; vector <int> v[30000]; int main(){ cin>>c>>d>>b>>m; if(b<5000 || c>50000){ x=3; while(true){ n=c*x+d; sum=0; while(n){ sum+=n%b; n/=b; } f[sum]++; if(f[sum]==m){ sol=sum; break; } x+=b-1; } x=3; while(m){ n=c*x+d; sum=0; while(n){ sum+=n%b; n/=b; } if(sum==sol){ cout<<x<<" "; m--; } x+=b-1; } }else{ x=3; while(true){ n=c*x+d; sum=0; while(n){ sum+=n%b; n/=b; } v[sum].push_back(x); if(v[sum].size()==m){ sol=sum; break; } x+=b-1; } for(i=0;i<m;i++) cout<<v[sol][i]<<" "; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 1144 KB | Output is correct |
2 | Correct | 101 ms | 3696 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 86 ms | 3192 KB | Output is correct |
2 | Correct | 80 ms | 3064 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 72 ms | 3236 KB | Output is correct |
2 | Correct | 74 ms | 3320 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 85 ms | 3268 KB | Output is correct |
2 | Correct | 72 ms | 3320 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 92 ms | 3448 KB | Output is correct |
2 | Correct | 262 ms | 2936 KB | Output is correct |
3 | Correct | 100 ms | 3364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 84 ms | 3448 KB | Output is correct |
2 | Correct | 95 ms | 3576 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 71 ms | 1016 KB | Output is correct |
2 | Correct | 813 ms | 1960 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1817 ms | 2808 KB | Output is correct |
2 | Correct | 1246 ms | 2940 KB | Output is correct |
3 | Execution timed out | 2057 ms | 2808 KB | Time limit exceeded |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 162 ms | 2916 KB | Output is correct |
2 | Correct | 1033 ms | 3064 KB | Output is correct |
3 | Correct | 95 ms | 3576 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 78 ms | 3448 KB | Output is correct |
2 | Correct | 90 ms | 2936 KB | Output is correct |