Submission #636784

#TimeUsernameProblemLanguageResultExecution timeMemory
636784lovrotGap (APIO16_gap)C++11
Compilation error
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> #define ll long long using namespace std; const int N = 3 * 1e5 + 10; ll niz[N]; ll findGap(int t, int n){ int minp = 0; int maxp = n - 1; ll mn = 0, minr; ll mx = INF, maxr; while(minp <= maxp){ MinMax(mn, mx, minr, maxr); niz[minp] = minr; niz[maxp] = maxr; mn = minr + 1; mx = maxr - 1; minp++; maxp--; } ll ans = 0; for(int i = 0; i < n - 1; i++) ans = max(ans, niz[i + 1] - niz[i]); return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:15:10: error: 'INF' was not declared in this scope
   15 |  ll mx = INF, maxr;
      |          ^~~
gap.cpp:18:24: error: 'maxr' was not declared in this scope; did you mean 'maxp'?
   18 |   MinMax(mn, mx, minr, maxr);
      |                        ^~~~
      |                        maxp