Submission #1355565

#TimeUsernameProblemLanguageResultExecution timeMemory
1355565idkcpGap (APIO16_gap)C++20
Compilation error
0 ms0 KiB
/**
 *       author:  Vi Gia Huy
 *    Vi Gia Huy will win VOI 27
**/

#include <bits/stdc++.h>
#include "gap.h>

using namespace std;

const int N = 1e5 + 6;
int n;
long long res;
long long mn;
long long mx;

namespace sub1 {
    long long a[N];

    void sol() {
        a[0] = -1;
        a[n + 1] = 1e18 + 1;
        int l = 1;
        int r = n;
        while (l <= n) {
            MinMax(a[l - 1] + 1, a[r + 1] - 1, mn, mx);
            a[l] = mn;
            a[r] = mx;
            l++;
            r--;
        }
        res = 1e18;
        for (int i = 1; i < n; i++) {
            res = max(res, a[i + 1] - a[i]);
        }

        return;
    }
}

namespace sub2 {
    void sol() {

        return;
    }
}

long long findGap(int _T, int _N) {
    n = N;
    if (T == 1) sub1::sol();
    else sub2::sol();
    return res;
}

Compilation message (stderr)

gap.cpp:7:10: warning: missing terminating " character
    7 | #include "gap.h>
      |          ^
gap.cpp:7:10: error: #include expects "FILENAME" or <FILENAME>
    7 | #include "gap.h>
      |          ^~~~~~~
gap.cpp: In function 'void sub1::sol()':
gap.cpp:26:13: error: 'MinMax' was not declared in this scope
   26 |             MinMax(a[l - 1] + 1, a[r + 1] - 1, mn, mx);
      |             ^~~~~~
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:50:9: error: 'T' was not declared in this scope
   50 |     if (T == 1) sub1::sol();
      |         ^