# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
502967 | doowey | Gap (APIO16_gap) | C++14 | 52 ms | 3216 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>
#include "gap.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define fi first
#define se second
#define mp make_pair
long long findGap(int T, int N){
if(T == 1){
ll low = -1, high = (ll)1e18 + 1;
vector<ll> C(N);
int L = 0, R = N - 1;
for(int i = 0 ; i < (N + 1) / 2; i ++ ){
MinMax(low + 1, high - 1, &low, &high);
C[L] = low;
C[R] = high;
L ++ ;
R -- ;
}
ll res = 0;
for(int i = 1; i < N; i ++ ){
res = max(res, C[i] - C[i - 1]);
}
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |