# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
560762 | messiuuuuu | 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 <bits/stdc++.h>
#define task "B"
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
using namespace std;
const int MAXN = 1e5 + 5;
const ll INF = 1e18 + 5;
int n;
ll ans = INF;
void Dnc(ll l, ll r)
{
ll mn, mx;
MinMax(l, r, &mn, &mx);
ll mid = (l + r) / 2;
if (mn == -1)
{
return;
}
ans = min(ans, mx - mn);
Dnc(l, mid);
Dnc(mid + 1, r);
}
void findGap(int t, int n)
{
ans = INF;
Dnc(1, 1e18);
}