# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
735876 | Abrar_Al_Samit | Gap (APIO16_gap) | C++17 | 52 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 <bits/stdc++.h>
#include "gap.h"
using namespace std;
const long long INF = 1e18;
long long solve1(int N) {
long long a[N+1];
int l = 1, r = N;
long long lef = 0, rit = INF;
while(l<=r) {
MinMax(lef, rit, &lef, &rit);
if(l==r) {
a[l] = lef;
break;
} else {
a[l] = lef, a[r] = rit;
++lef, --rit;
++l, --r;
}
}
long long best = 0;
for(int i=2; i<=N; ++i) {
best = max(best, a[i] - a[i-1]);
}
return best;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |