# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
540514 | dutinmeow | Gap (APIO16_gap) | C++17 | 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>
using namespace std;
#include "gap.h"
const long long MAX_A = 1e18;
void findGap(int T, int N) {
if (T == 1) {
long long l = 1, r = MAX_A;
vector<long long> A;
for (int i = 0; i < (N + 1) / 2; i++) {
long long nl, nr;
MinMax(l, r, nl, nr);
A.push_back(l);
A.push_back(r);
l = ++nl, r = --nr;
}
sort(A.begin(), A.end());
long long ans = 0;
for (int i = 1; i < N; i++)
ans = max(ans, A[i] - A[i - 1]);
cout << ans << '\n';
} else {
}
}