Submission #1083348

#TimeUsernameProblemLanguageResultExecution timeMemory
1083348djs100201Gap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> #define all(v) v.begin(), v.end() using namespace std; using ll = long long; using P = pair<ll, ll>; using PP = pair<ll, P>; const ll n_ = 2e5 + 10, inf = (ll)2e9 * (ll)1e9 + 7, mod = 998244353; ll n, m, tc = 1, a, b, c, d, sum, x, y, z, base, ans, k; ll findGap(int T, int N) { vector<ll> res(N); ll l = 0, r = 1e18, mn, mx; ll lidx = 0, ridx = N - 1; while (lidx <= ridx) { if (lidx == ridx) { MinMax(l + 1, (ll)1e18, &mn, &mx); res[lidx] = mn; break; } MinMax(l + 1, r - 1, &mn, &mx); res[lidx++] = mn, rs[ridx--] = mx; l = res[lidx], r = res[ridx]; } ll ret = 0; for (int i = 1; i < N; i++) ret = max(ret, res[i] - res[i - 1]); return ret; }

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:21:21: error: 'rs' was not declared in this scope; did you mean 'r'?
   21 |   res[lidx++] = mn, rs[ridx--] = mx;
      |                     ^~
      |                     r