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 pb push_back
#define all(v) v.begin(), v.end()
#define ll long long
ll findGap(int t, int n){
ll answer = 0;
if(t == 1){
ll l = 1, r = 1e18, id = 0, mn, mx;
vector<ll> a;
a.resize(n+5);
for(int i = 0; i < (n+1)/2; ++i){
MinMax(l, r, &mn, &mx);
a[id++] = mn;
a[id++] = mx;
l = mn+1, r = mx-1;
}
sort(all(a));
for(int i = 0; i < n-1; ++i)
answer = max(answer, a[i+1]-a[i]);
return answer;
}
return answer;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |