Submission #23296

#TimeUsernameProblemLanguageResultExecution timeMemory
23296repeatingGap (APIO16_gap)C++11
0 / 100
73 ms5144 KiB
#include <bits/stdc++.h> #define F first #define S second #define P push #define pb push_back #define MEM(dp,i) memset(dp,i,sizeof(dp)) #define W while #define R return #define C continue #define SI size() #define ll long long #define pll pair<ll,ll> #define SF(x) scanf("%I64d",&x) using namespace std; const long long INF = 2e9; long long MOD = 1e9+7; void MinMax(ll ,ll ,ll *,ll *); long long findGap(int ,int ); long long findGap(int t,int n){ ll l=0,r=1e18; ll res=0; ll l1=1e18,r1=0; W(l<=r){ MinMax(l,r,&l,&r); if(l==-1)break; res=max(res,max(r1-r,l-l1)); r1=r,l1=l; r--,l++; } res=max(res,r1-l1); R res; } //int main(){ // cout<<findGap(1,1); //} //void MinMax(ll s,ll t,ll *mn,ll *mx){ // cout<<s<<" "<<t<<endl; // cin>>*mn>>*mx; //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...