| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 832765 | tolbi | Gap (APIO16_gap) | C++17 | 36 ms | 2080 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)
{
long long l, r;
int qu = 0;
qu++;
if (qu>(N+1)/2) assert(false);
MinMax(0,1e18,&l,&r);
l++,r--;
long long ans = 0;
if (N==2){
return r-l+2;
}
while (l<r){
long long newl, newr;
qu++;
if (qu>(N+1)/2) assert(false);
MinMax(l,r,&newl,&newr);
if (newl==-1) {
ans=max(ans,r-l+2);
break;
}
ans=max(ans,newl-l+1);
l=newl+1;
ans=max(ans,r-newr+1);
r=newr-1;
}
return ans;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
