Submission #168175

#TimeUsernameProblemLanguageResultExecution timeMemory
168175rzbtKotrljanje (COCI18_kotrljanje)C++14
126 / 140
1100 ms20872 KiB
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define F first #define S second #define all(x) x.begin(),x.end() #define MAXN 200005 typedef long long ll; using namespace std; ll c,d,b,m; vector<ll > lol[MAXN]; int main() { scanf("%lld %lld %lld %lld",&c,&d,&b,&m); for(int i=1;;i+=(b-1)){ ll tren=d+i*c; ll zc=0; while(tren>0){ zc+=tren%b; tren/=b; } lol[zc].pb(i); if(lol[zc].size()>=m){ for(auto x:lol[zc])printf("%d ",x); return 0; } } return 0; }

Compilation message (stderr)

kotrljanje.cpp: In function 'int main()':
kotrljanje.cpp:27:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(lol[zc].size()>=m){
            ~~~~~~~~~~~~~~^~~
kotrljanje.cpp:28:46: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
             for(auto x:lol[zc])printf("%d ",x);
                                              ^
kotrljanje.cpp:18:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld %lld %lld %lld",&c,&d,&b,&m);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...