# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
500300 | ausbol | Swimming competition (LMIO18_plaukimo_varzybos) | C++14 | 367 ms | 10904 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |