Submission #843894

#TimeUsernameProblemLanguageResultExecution timeMemory
843894Elvin_FritlGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long findGap(int t, int n) { long long mn = 0 , mx = 1e18 + 1; vector<long long>v; int tr = (n+1)/2; while(tr--) { MinMax(mn , mx , &mn , &mx); v.push_back(mn); if(mn != mx) v.push_back(mx); mn++; mx--; } sort(v.begin() , v.end()); long long res = 0; for(int i=1;i<n;i++){ res = max(v[i] , v[i-1] , res); } return res; }

Compilation message (stderr)

In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from gap.cpp:4:
/usr/include/c++/10/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
gap.cpp:25:38:   required from here
/usr/include/c++/10/bits/stl_algobase.h:303:17: error: '__comp' cannot be used as a function
  303 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~