Submission #284833

#TimeUsernameProblemLanguageResultExecution timeMemory
284833triplem5dsGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include "bits/stdc++.h" using namespace std; long long findGap(int T, int N) { if(T == 2){ long long cur = 0; vector<long long > vr; long long ans = 0; for(int i = 0; i < N; i++){ long long * mn, * mx; MinMax(cur, cur, mn, mx); vr.push_back(*mn); cur = *mn + 1; if(i)ans = max(ans, vr[i] - vr[i-1]); } } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:18:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |   return ans;
      |          ^~~
      |          abs