# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
549776 | Pherokung | Gap (APIO16_gap) | C++14 | 0 ms | 0 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<bits/stdc++.h>
using namespace std;
#define ll long long
ll findGap(int T, int N)
{
vector<ll> V;
if(T == 1){
ll be,ed,ans=0;
Minmax(1,1e18,be,ed);
V.push_back(be), V.push_back(ed);
while(ed - be > 1){
Minmax(be+1,ed-1,be,ed);
}
if(be == ed) V.push_back(ed);
sort(V.begin(),V.end());
for(int i=1;i<V.size();i++) ans = max(ans,V[i]-V[i-1]);
return ans;
}
}