Submission #832757

#TimeUsernameProblemLanguageResultExecution timeMemory
832757tolbiGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long findGap(int T, int N) { long long l, r; int qu = 0; qu++; if (qu>(n+1)/2) assert(false); MinMax(0,1e18,&l,&r); l++,r--; long long ans = 0; while (l<r){ long long newl, newr; qu++; if (qu>(n+1)/2) assert(false); MinMax(l,r,&newl,&newr); if (newl==-1) { ans=max(ans,r-l+2); break; } ans=max(ans,newl-l+1); l=newl+1; ans=max(ans,r-newr+1); r=newr-1; } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:9:10: error: 'n' was not declared in this scope
    9 |  if (qu>(n+1)/2) assert(false);
      |          ^
gap.cpp:16:11: error: 'n' was not declared in this scope
   16 |   if (qu>(n+1)/2) assert(false);
      |           ^