Submission #341770

#TimeUsernameProblemLanguageResultExecution timeMemory
341770blueGap (APIO16_gap)C++11
Compilation error
0 ms0 KiB
#include "gap.h" #include <algorithm> #include <cmath> using namespace std; long long findGap(int T, int N) { if(T == 1) { long long s, t; long long mn, mx; s = 0; t = 1000000000000000000LL; long long res = 0; MinMax(s, t, &mn, &mx); s = mn+1; t = mx-1; while(1) { MinMax(s, t, &mn, &mx); if(mn == -1) return res; res = max(res, s-mn, mx-t); s = mn+1; t = mx-1; } } return -1; }

Compilation message (stderr)

In file included from /usr/include/c++/9/algorithm:61,
                 from gap.cpp:2:
/usr/include/c++/9/bits/stl_algobase.h: In instantiation of 'const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
gap.cpp:24:38:   required from here
/usr/include/c++/9/bits/stl_algobase.h:271:17: error: '__comp' cannot be used as a function
  271 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~