# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
719927 | joelgun14 | Gap (APIO16_gap) | C++17 | 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>
#define ll long long
using namespace std;
long long findGap(int T, int N)
{
// can call findmax function
// let's say range is between 1 to 1e18
// divide n into blocks size n / k
if(t == 1) {
ll l = 0, r = 1e18;
ll a[N];
for(int i = 0; i < N / 2 + N % 2; ++i) {
MinMax(l, r, a[i], a[N - i - 1]);
l = a[i] + 1, r = a[N - i - 1] - 1;
}
ll mxdiff = 0;
for(int i = 1; i < N; ++i)
mxdiff = max(mxdiff, a[i] - a[i - 1]);
return mxdiff;
}
else {
// divide N into blocks
}
return 0;
}