Submission #145020

#TimeUsernameProblemLanguageResultExecution timeMemory
145020alexandra_udristoiuKotrljanje (COCI18_kotrljanje)C++14
140 / 140
1107 ms18472 KiB
#include<iostream> #include<vector> using namespace std; long long c, d, b, m, i, x, s; int ff[100000]; vector<long long> v[100000]; int main(){ cin>> c >> d >> b >> m; for(i = 1; ; i++){ x = c * i * (b - 1) + d; s = 0; while(x != 0){ s += x % b; x /= b; } ff[s]++; v[s].push_back(i * (b - 1) ); if(ff[s] == m){ for(i = 0; i < v[s].size(); i++){ cout<< v[s][i] <<" "; } return 0; } } }

Compilation message (stderr)

kotrljanje.cpp: In function 'int main()':
kotrljanje.cpp:19:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(i = 0; i < v[s].size(); i++){
                        ~~^~~~~~~~~~~~~
#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...