Submission #30724

#TimeUsernameProblemLanguageResultExecution timeMemory
30724PrOAhMeTGap (APIO16_gap)C++14
0 / 100
73 ms6772 KiB
#include "gap.h" #include <bits/stdc++.h> #define mp make_pair #define pb push_back #define pii pair<int,int> #define LL long long #define st first #define nd second #define endl '\n' using namespace std; long long findGap(int T, int N) { vector<LL> v; LL x=-1,y=1e18+1,nx,ny,ret=0,cnt=0; if(T==1) { while(cnt<N) { MinMax(x+1,y-1,&nx,&ny); x=nx; y=ny; v.pb(x); ++cnt; if(x!=y) { v.pb(y); ++cnt; } x=nx; y=ny; } sort(v.begin(),v.end()); for(int i=1;i<v.size();++i) ret=max(ret,v[i]-v[i-1]); return ret; } else { } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:32:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=1;i<v.size();++i)
                ^
gap.cpp:43:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...