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"
#define maxs(i, j) (i = max(i, j))
#define fastio ios::sync_with_stdio(false);cin.tie(nullptr);
#define ln '\n'
#define nwln cout<<ln;
using namespace std;
typedef long long ll;
const ll LINF = 1001001001001001001;
ll a[100001], pos, ans, mn, mx;
ll findGap(int T, int N) {
ll l = 1, r = LINF;
for(int i = 0; i<((N+1)>>1); ++i) {
MinMax(l, r, &mn, &mx);
a[pos++] = mn, a[pos++] = mx;
l = mn + 1, r = mx - 1;
}
sort(a, a + N);
for(ll i=1; i<N; ++i) maxs(ans, (a[i] - a[i-1]));
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |