Submission #145057

#TimeUsernameProblemLanguageResultExecution timeMemory
145057Linca_RobertKotrljanje (COCI18_kotrljanje)C++14
28 / 140
1106 ms18428 KiB
#include<bits/stdc++.h> using namespace std; const int DIM = 1e5; int C, D, B, M; long long curr, aux; vector<long long> arr[DIM]; inline int suma( long long x ){ int s = 0; while( x != 0 ){ s += x % B; x /= B; } return s; } int main(){ cin >> C >> D >> B >> M; aux = 1LL * C * (B - 1); curr = aux + D; for( int i = 1; ; i++ ){ int s = suma( curr ); arr[s].push_back( i ); if( arr[s].size() == M ){ for( int j = 0; j < arr[s].size(); j++ ) cout << arr[s][j] << " "; break; } curr += aux; } return 0; }

Compilation message (stderr)

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