Submission #143818

#TimeUsernameProblemLanguageResultExecution timeMemory
143818nicolaalexandraKotrljanje (COCI18_kotrljanje)C++14
0 / 140
185 ms51756 KiB
#include <iostream> #include <vector> using namespace std; //ifstream cin ("date.in"); //ofstream cout ("date.out"); int c,d,b,m; vector <int> v[1000000]; int main (){ cin>>c>>d>>b>>m; for (int nr=0;;nr+=(b-1)){ int val = c*nr+d; int aux = val, sum = 0; while (aux){ sum += aux%b; aux /= b; } v[sum].push_back(nr); if (v[sum].size() == m){ for (int i=0;i<v[sum].size();i++) cout<<v[sum][i]<<" "; return 0; }} return 0; }

Compilation message (stderr)

kotrljanje.cpp: In function 'int main()':
kotrljanje.cpp:20:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (v[sum].size() == m){
             ~~~~~~~~~~~~~~^~~~
kotrljanje.cpp:21:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int i=0;i<v[sum].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...