Submission #141217

#TimeUsernameProblemLanguageResultExecution timeMemory
141217mariusnicoliKotrljanje (COCI18_kotrljanje)C++14
28 / 140
2088 ms3192 KiB
#include <iostream> #include <vector> #include <map> using namespace std; int mp[30000]; long long c, d, b, m, p, i, n, suma, sol; 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; } mp[suma] ++; if (mp[suma] == m) { sol = suma; break; } ///} } for (i=1;m;i++) { n = 1LL*c*i*p+d; suma = 0; while (n) { suma += n%b; n/=b; } if (suma == sol) { cout<<i*p<<" "; m--; } ///} } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...