Submission #500300

#TimeUsernameProblemLanguageResultExecution timeMemory
500300ausbolSwimming competition (LMIO18_plaukimo_varzybos)C++14
10 / 100
367 ms10904 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, a, b; cin >> n >> a >> b; int x[n]; for(int i=0; i<n; i++) cin >> x[i]; sort(x, x+n); if(a==b){ int kelintas=0, prad; int ats=0; for(int i=0; i<n; i++){ kelintas++; if(kelintas==1) prad=x[i]; if(kelintas==a){ kelintas=0; ats=max(x[i]-prad, ats); } } cout << ats; } return 0; }

Compilation message (stderr)

plaukimo_varzybos.cpp: In function 'int main()':
plaukimo_varzybos.cpp:20:29: warning: 'prad' may be used uninitialized in this function [-Wmaybe-uninitialized]
   20 |                 ats=max(x[i]-prad, ats);
      |                         ~~~~^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...