Submission #843619

# Submission time Handle Problem Language Result Execution time Memory
843619 2023-09-04T09:07:44 Z Elvin_Fritl Gap (APIO16_gap) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

#include "gap.h"

long long findGap(int t, int n)
{
    long long mini = 0 , maxi = 1e18 + 1;
    vector<long long>v;
    int tr = (n+1)/2;
    while(tr--)
    {
        long long mn,mx;
        MinMax(mini , maxi , &mn , &mx);
        v.push_back(mn);
        if(mn != mx)
            v.push_back(mx);
        mini = mn + 1;
        maxi = mx - 1;
    }
    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

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:1:
/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:24: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))
      |           ~~~~~~^~~~~~~~~~