Submission #143824

#TimeUsernameProblemLanguageResultExecution timeMemory
143824nicolaalexandraKotrljanje (COCI18_kotrljanje)C++14
140 / 140
1136 ms39972 KiB
#include <iostream> #include <vector> using namespace std; //ifstream cin ("date.in"); //ofstream cout ("date.out"); int c,d,b,m; vector <long long> v[1000000]; int main (){ cin>>c>>d>>b>>m; for (long long nr=0;;nr+=(b-1)){ long long val = 1LL*c*nr+d; long long aux = val; int 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:21:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (v[sum].size() == m){
             ~~~~~~~~~~~~~~^~~~
kotrljanje.cpp:22: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...