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 MEM(dp,i) memset(dp,i,sizeof(dp))
#define R return
#define F first
#define S second
#define C continue
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
const int MX=5009;
const ll mod=1e9+7;
const ll inf=(1ll<<60);
int findGap(int T,int n){
ll mn,mx,ans=0,a,b;
MinMax(0,1e18+10,&mn,&mx);
if(T==1){
for(int i=1;i<(n+1)/2;i++){
MinMax(mn+1,mx-1,&a,&b);
ans=max(ans,a-mn);
ans=max(ans,mx-b);
mn=a;
mx=b;
}
ans=max(ans,mx-mn);
}
R ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |