# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
523796 | vonatlus | Gap (APIO16_gap) | C++17 | 26 ms | 1872 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 "gap.h"
#pragma GCC optimize("O3")
//#pragma comment(linker, "/STACK:36777216")
#include<bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define sz(x) (int) x.size()
#define all(z) (z).begin(), (z).end()
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 1e2;
long long findGap(int T, int n) {
vector<ll> a(n);
ll l = 0, r = 1e18;
for (int i = 0; i < (n+1)/2; ++i) {
ll *nl, *nr;
MinMax(l, r, nl, nr);
a[i] = *nl;
a[n-i-1] = *nr;
l = a[i]+1, r = a[n-i-1]-1;
}
ll ans = 0;
for (int i = 1; i < n; ++i) {
ans = max(ans, a[i]-a[i-1]);
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |