Submission #953929

#TimeUsernameProblemLanguageResultExecution timeMemory
9539294QT0RGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; #define ll long long ll findGap(int T, int n){ ll L,P; MinMax(0,1e18,&L,&P); ll d=(P-L)/(n-1); ll ans=0,x,y; while(true){ MinMax(L+1,P-1,&x,&y); if (x==-1){ ans=max(ans,P-L); return; } else ans=max({ans,x-L,P-y}); L=x; P=y; } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:15:4: error: return-statement with no value, in function returning 'long long int' [-fpermissive]
   15 |    return;
      |    ^~~~~~
gap.cpp:9:5: warning: unused variable 'd' [-Wunused-variable]
    9 |  ll d=(P-L)/(n-1);
      |     ^