Submission #144224

#TimeUsernameProblemLanguageResultExecution timeMemory
144224AldeaDanutKotrljanje (COCI18_kotrljanje)C++14
140 / 140
1110 ms17264 KiB
#include <iostream> #include <vector> using namespace std; long long n,c,d,b,m,x,i,sum,sol; int f[30000]; vector <long long> v[30000]; int main(){ cin>>c>>d>>b>>m; x=3; while(true){ n=c*x+d; sum=0; while(n){ sum+=n%b; n/=b; } v[sum].push_back(x); if(v[sum].size()==m){ sol=sum; break; } x+=b-1; } for(i=0;i<v[sol].size();i++) cout<<v[sol][i]<<" "; return 0; }

Compilation message (stderr)

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