Submission #141366

#TimeUsernameProblemLanguageResultExecution timeMemory
141366mariusnicoliKotrljanje (COCI18_kotrljanje)C++14
126 / 140
2035 ms2936 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; long long x = 3; for (i=1;;i++) { n = c*x+d; suma = 0; while (n) { suma += n%b; n/=b; } mp[suma] ++; if (mp[suma] == m) { sol = suma; break; } x += (b-1); } x = 3; for (i=1;m;i++) { n = c*x+d; suma = 0; while (n) { suma += n%b; n/=b; } if (suma == sol) { cout<<x<<" "; m--; } x += (b-1); } }
#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...