Submission #141175

#TimeUsernameProblemLanguageResultExecution timeMemory
141175mariusnicoliKotrljanje (COCI18_kotrljanje)C++14
28 / 140
1833 ms65540 KiB
#include <iostream> #include <vector> #include <map> using namespace std; map<int, vector<long long>> mp; long long c, d, b, m, p, i, n, suma; int main () { cin>>c>>d>>b>>m; p = 1; while (p <= d) p*=b; for (i=1;;i++) { n = 1LL*c*i*p+d; suma = 0; while (n) { suma += n%b; n/=b; } ///if (mp.find(suma) == mp.end()) { mp[suma].push_back(i*p); if (mp[suma].size() == m) { for (int i=0;i<mp[suma].size();i++) cout<<mp[suma][i]<<" "; return 0; } ///} } }

Compilation message (stderr)

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