Submission #95567

# Submission time Handle Problem Language Result Execution time Memory
95567 2019-02-02T05:57:19 Z lyc Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

long long findGap(int T, int N)
{
    ll s, t, mn, mx;
    s = 0, t = (ll)1e18;
    ll arr[N];
    for (int i = 0; i < (N+1)/2; ++i) {
        MinMax(s, t, &mn, &mx);
        arr[i] = mn;
        arr[N-1-i] = mx;
        s = mn+1;
        t = mx-1;
        //cout << "FOUND " << mn << " " << mx << '\n';
    }
    //for (int i = 0; i < N; ++i) cout << arr[i] << ' ' ;cout << endl;

    ll ans = 0;
    for (int i = 1; i < N; ++i) {
        ans = max(ans, arr[i]-arr[i-1]);
    }
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:12:9: error: 'MinMax' was not declared in this scope
         MinMax(s, t, &mn, &mx);
         ^~~~~~
gap.cpp:12:9: note: suggested alternative: 'rindex'
         MinMax(s, t, &mn, &mx);
         ^~~~~~
         rindex