# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
469923 | jazzup | Gap (APIO16_gap) | C++14 | 57 ms | 2232 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 "gap.h"
#include<vector>
#include<algorithm>
using namespace std;
vector<long long> v;
long long st=0,ed=1e18;
long long findGap(int T, int N){
if(T==1){
long long mn=st,mx=ed;
for(int i=0;i<(N+1)/2;i++){
MinMax(mn,mx,&mn,&mx);
v.push_back(mn);
if(mx!=mn)v.push_back(mx);
mn++;
mx--;
}
sort(v.begin(),v.end());
long long ans=0;
for(int i=0;i<v.size()-1;i++){
ans=max(ans,v[i+1]-v[i]);
}
return ans;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |