| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366264 | vahagng | Gap (APIO16_gap) | C++20 | 12 ms | 1952 KiB |
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
long long a[100001];
long long findGap(int T, int N){
long long mn = 0, mx = 1e18;
for(int i = 0; i < N / 2; i++){
MinMax(mn, mx, &mn, &mx);
a[i] = mn;
a[N - i - 1] = mx;
}
if(N & 1){
MinMax(mn, mx, &mn, &mx);
a[(N + 1) / 2] = mn;
}
long long res= 0;
for(int i = 1; i < N; i++){
res = max(res, a[i] - a[i - 1]);
}
return res;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
