Submission #560222

#TimeUsernameProblemLanguageResultExecution timeMemory
560222Trisanu_DasGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" #define int long long int using namespace std; int findGap(int type, int n){ int ma, mi, ans; MinMax(0, 2e18, &mi, &ma); if(type == 1){ for(int i = 1; i < (n + 1) / 2; ++i){ int currma, currmi; MinMax(mi + 1, ma - 1, &currmi, &currma); ans = max(ans, max(currmi - mi, ma - currma)); mi = currmi; ma = currma; } return ans = max(ans, mx - mn); } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:16:27: error: 'mx' was not declared in this scope; did you mean 'mi'?
   16 |     return ans = max(ans, mx - mn);
      |                           ^~
      |                           mi
gap.cpp:16:32: error: 'mn' was not declared in this scope; did you mean 'mi'?
   16 |     return ans = max(ans, mx - mn);
      |                                ^~
      |                                mi