# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
667327 | Mahdi | Gap (APIO16_gap) | C++17 | 49 ms | 2324 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>
#include "gap.h"
using namespace std;
#define all(v) v.begin(), v.end()
typedef long long ll;
long long findGap(int T, int N){
if(T==1){
vector<ll>v;
ll a=-1, b=1e18+1, c, d;
for(int i=0;i<N;i+=2){
MinMax(a+1, b-1, &c, &d);
v.push_back(c);
v.push_back(d);
a=c;
b=d;
}
sort(all(v));
ll ans=0;
for(int i=1;i<v.size();++i)
ans=max(ans, v[i]-v[i-1]);
return ans;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |