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>
typedef long long ll;
using namespace std;
long long findGap(int T, int N) {
if(T == 1 || T == 2) {
vector<ll> nums(N);
ll a, b, x, y, i = 0;
a = 0, b = 1000000000000000000LL;
while(i * 2 < N) {
MinMax(a, b, &x, &y);
nums[i] = x;
nums[N - i - 1] = y;
i++; a = x + 1; b = y - 1;
}
ll ans = 0;
for(int i = 1; i < N; i++) {
ans = max(ans, nums[i] - nums[i-1]);
}
return ans;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |