# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
45258 | nibnalin | Gap (APIO16_gap) | C++17 | 116 ms | 2276 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 <iostream>
#include <cstdio>
#include <vector>
#include "gap.h"
using namespace std;
typedef long long int lli;
const lli maxn = int(1e5)+5, inf = lli(1e18)+1;
lli ans = 0, A[maxn];
void sub1(lli n)
{
pair<lli, lli> range = {0, inf};
lli L = 0, R = n-1;
while(L <= R)
{
MinMax(range.first, range.second, &A[L], &A[R]);
range.first = A[L]+1, range.second = A[R]-1;
L++, R--;
}
for(lli i = 1;i < n;i++) ans = max(ans, A[i]-A[i-1]);
}
void qry(lli L, lli R)
{
//cout << L << " " << R << "\n";
if(R-L < ans) return;
pair<lli, lli> left = {L, (L+R)/2}, right = {(L+R)/2+1, R};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |