# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
978369 | | Amr | Gap (APIO16_gap) | C++17 | | 29 ms | 2228 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;
typedef long long ll;
#define sz size()
ll a[300005];
long long findGap(int T, int N)
{
ll n = N;
ll l = 1, r = 1e18;
ll l1 = 0,r1 = n-1;
while(l1<=r1)
{
ll fl = l , fr = r;
MinMax(fl,fr,&l,&r);
a[l1++] = l , a[r1--] = r;
l++,r--;
}
ll mx = 0;
//for(int i = 0; i < n; i++) cout << a[i] << " "; cout << endl;
for(int i = 1; i < n; i++) mx = max(mx,a[i]-a[i-1]);
return mx;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |