# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
256836 | AM1648 | Gap (APIO16_gap) | C++17 | 61 ms | 1916 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.
/* be name khoda */
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
#define forifrom(i, s, n) for (ll i = s; i < n; ++i)
#define fori(i, n) forifrom(i, 0, n)
#define F first
#define S second
// ------------------------------------------------------------------
const ll maxn = 100010;
const ll maxa = 1000000000000000000;
ll A[maxn];
long long findGap(int T, int N) {
if (T == 1) {
A[0] = -1;
A[N + 1] = maxa + 1;
for (ll i = 0, j = N + 1; j - i > 1; ++i, --j) {
MinMax(A[i] + 1, A[j] - 1, A + i + 1, A + j - 1);
}
ll ans = 0;
forifrom (i, 1, N) ans = max(ans, A[i + 1] - A[i]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |