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 <algorithm>
using namespace std;
#define ll long long
const ll MAX = 1e18;
const int N = 1e5 + 5;
ll a[N];
long long findGap(int t, int n)
{
if (t == 1) {
ll l = 0, r = MAX;
int x = 0, y = n - 1;
while (x <= y) {
MinMax(l, r, &a[x], &a[y]);
l = a[x] + 1;
r = a[y] - 1;
x++;
y--;
}
ll mx = 0;
for (int i = 0; i < n - 1; i++)
mx = max(mx, a[i + 1] - a[i]);
return mx;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |