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;
typedef long long ll;
typedef pair<int,int> pii;
const ll INF = 1e18;
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define mk make_pair
#define pb push_back
#define fr first
#define sc second
ll findGap(int T, int N) {
if(T == 1) {
vector<ll> a(N);
int l = 0, r = N-1;
ll val1 = 0, val2 = INF;
while(l <= r) {
MinMax(val1, val2, &a[l], &a[r]);
val1 = a[l] + 1;
val2 = a[r] - 1;
l++;
r--;
}
ll ans = 0;
for(int i = 1; i < N; i++)
ans = max(ans, a[i] - a[i-1]);
return ans;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |