Submission #1096917

#TimeUsernameProblemLanguageResultExecution timeMemory
1096917NewtonabcGap (APIO16_gap)C++14
30 / 100
34 ms1996 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; const int N=1e5+10; long long arr[N]; long long findGap(int T, int N) { if(T==1){ long long ans=LLONG_MIN; int lind=1,rind=N; long long l=0,r=1e18,mn,mx; while(lind<=rind){ MinMax(l,r,&mn,&mx); if(mn==-1) break; arr[lind]=mn,arr[rind]=mx; lind++,rind--; l=mn+1,r=mx-1; } for(int i=1;i<N;i++){ ans=max(ans,arr[i+1]-arr[i]); } /*for(int i=0;i<N;i++) cout<<arr[i] <<" "; cout<<"\n\n";*/ return ans; } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...