Submission #387531

#TimeUsernameProblemLanguageResultExecution timeMemory
387531MeGustaElArroz23Gap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vi;

ll findGap(int T, int n){
    if (T==1){
        vi v(n);
        auto l=v.begin();
        auto r=v.end();
        ll up=1e18,low=0;
        r--;
        for (int i=0;i<(n+1)/2;i++){
            MinMax(low,up,l,r);
            low=*l+1;
            up=*r-1;
            l++;
            r--;
        }
        ll mejor=0;
        for (int i=0;i<n-1;i++){
            mejor=max(mejor,v[i+1]-v[i]);
        }
        return mejor;
    }
}

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:15:13: error: 'MinMax' was not declared in this scope
   15 |             MinMax(low,up,l,r);
      |             ^~~~~~
gap.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      | ^