Submission #23353

#TimeUsernameProblemLanguageResultExecution timeMemory
23353HassoonyGap (APIO16_gap)C++11
30 / 100
56 ms5144 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...