# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
679159 | tigar | 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>
#include "gap.h"
using namespace std;
typedef long long ll;
ll mn, mx;
ll findGap(int T, int N)
{
if(T==1)
{
ll up_bound=LONG_LONG_MAX, low_bound=0;
MinMAx(low_bound, up_bound, &mn, &mx);
ll a=mn, b=mx;
ll razlika=0;
while(mn!=-1 and up_bound>=low_bound)
{
MinMAx(low_bound, up_bound, &mn, &mx);
razlika=max(razlika, max(mn-a, b-mx));
low_bound=mn+1; up_bound=mx-1;
}
return razlika;
}
}