Submission #106759

# Submission time Handle Problem Language Result Execution time Memory
106759 2019-04-20T10:18:31 Z brcode Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include <iostream>

using namespace std;
const int MAXN = 1e6+5;
long long arr[MAXN];
long long findgap(long long T,long long N){
    long long a = 1;
    long long b = 1e18;
    long long l = 0;
    long long r = N-1;
    long long mn,mx;
    long long total = 0;
    while(total<N){
        MinMax(a, b, &mn, &mx);
        arr[l] = mn;
        arr[r] = mx;
        l++;
        r--;
        total+=2;
        a = mn+1;
        b = mx-1;
    }
    long long diff = 0;
    for(long long i=0;i<N-1;i++){
        diff = max(diff,arr[i+1]-arr[i]);
    }
    return diff;
}

Compilation message

gap.cpp: In function 'long long int findgap(long long int, long long int)':
gap.cpp:14:9: error: 'MinMax' was not declared in this scope
         MinMax(a, b, &mn, &mx);
         ^~~~~~