| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 975830 | Isam | Gap (APIO16_gap) | C++17 | 34 ms | 3868 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 "gap.h"
#include<bits/stdc++.h>
using namespace std;
long long findGap(int T, int N){
if(!(T==1||N<=10)) return 0ll;
vector<long long> a(N+1, 0ll);
long long mn, mx;
MinMax(0ll, (long long)1E18, &mn, &mx);
a[1] = mn, a[N] = mx;
for(register int i = 2; i <= N/2 + (N & 1); ++i){
long long l = a[i-1], r = a[N - (i-1) + 1];
MinMax(l+1, r-1, &mn, &mx); // called by reference
a[i] = mn, a[N - i + 1] = mx;
}
long long ans = -((long long)1E18 + 7);
for(register int i = 2; i <= N; ++i){
ans = max(ans, a[i] - a[i-1]);
}
return ans;
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
