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>
using namespace std;
#define ll long long
long long findGap(int T, int N)
{
ll arr[N], x=0, y=1e18, a, b, idx=0, mx=0;
while (1)
{
MinMax(x, y, &a, &b);
if (a==-1) break;
arr[idx]=a;
arr[N-idx-1]=b;
x=a+1; y=b-1;
idx++;
}
for (int i=0; i<N-1; i++) mx=max(mx, arr[i+1]-arr[i]);
return mx;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |