# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
38741 | oTTo_22 | Gap (APIO16_gap) | C++14 | 2000 ms | 524288 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"
#define se second
#define fi first
using namespace std;
long long ans;
void func (long long L,long long R) {
long long mi1,ma1,mi2,ma2;
long long mid=(L+R)/2;
MinMax(L,mid,&mi1,&ma1);
MinMax(mid,R,&mi2,&ma2);
if (mi1==-1 && mi2==-1) {
ans=max(ans,R-L);
return ;
}
if (mi1==-1) {
ans=max(ans,mi2-L);
return;
}
if (mi2==-1) {
ans=max(ans,R-ma1);
return;
}
func(L,ma1);
func(mi2,R);
}
long long findGap(int T, int N)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |