Submission #564943

# Submission time Handle Problem Language Result Execution time Memory
564943 2022-05-20T04:14:18 Z Spade1 Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "gap.h"
#define pii pair<int, int>
#define pll pair<long long, long long>
#define ll long long
#define ld long double
#define st first
#define nd second
#define pb push_back
#define INF INT_MAX
using namespace std;

const int NN = 1e5 + 10;

ll a[NN];

ll findGap(ll T, ll N) {
    ll mn, mx;
    ll _max = 0;
    MinMax(0, 1e18, &mn, &mx);
    a[1] = mn, a[N] = mx;
    int i = 1;
    while (1) {
        MinMax(a[i]+1, a[N-i+1]-1, &mn, &mx);
        if (mn == -1 && mx == -1) break;
        if (mn == mx) {
            a[i+1] = mn;
            break;
        }
        a[i+1] = mn;
        a[N-i] = mx;
        i++;
    }

    for (int i = 1; i < N; ++i) {
        _max = max(_max, a[i+1]-a[i]);
    }
    return _max;
}

Compilation message

/usr/bin/ld: /tmp/ccItcY1Q.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status