Submission #560764

#TimeUsernameProblemLanguageResultExecution timeMemory
560764Tien_NoobGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
//Make CSP great again
//Vengeance
#include <bits/stdc++.h>
//#include "gap.h"
#define TASK "TESTCODE"
#define Log2(x) 31 - __builtin_clz(x)
using namespace std;
const int N = 1e5;
long long a[N + 2];
long long findGap(int t, int n)
{
    if (t == 2)
    {
        a[0] = -1;
        a[n + 1] = 1e18 + 1;
        for (int i = 1, j = n; i <= j; ++ i, -- j)
        {
            MinMax(a[i - 1], a[j + 1], a[i], a[j]);
        }
        long long res = 0;
        for (int i = 2; i <= n; ++ i)
        {
            res = max(res, a[i] - a[i - 1]);
        }
        return res;
    }
    else
    {
        long long res = 0;
        long long mn, mx;
        MinMax(0, 1e18, &mn, &mx);
        long long maxPre = -1;
        long long tmn, tmx;
        tmn = mn;
        tmx = mx;
        if (n == 2)
        {
            return mx - mn;
        }
        --n;
        for (long long l = tmn; l < tmx; l += (tmx - tmn)/n + 1)
        {
            MinMax(l, l + (tmx - tmn)/n, &mn, &mx);
            if (mn == -1)
            {
                continue;
            }
            if (maxPre != -1)
            {
                res = max(res, mn - maxPre);
            }
            maxPre = mx;
        }
        return res;
    }
}
/*void read()
{

}
void solve()
{

}
int  main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    if (fopen(TASK".INP", "r"))
    {
        freopen(TASK".INP", "r", stdin);
        //freopen(TASK".OUT", "w", stdout);
    }
    int t = 1;
    bool typetest = false;
    if (typetest)
    {
        cin >> t;
    }
    for (int __ = 1; __ <= t; ++ __)
    {
        //cout << "Case " << __ << ": ";
        read();
        solve();
    }
}*/

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:18:13: error: 'MinMax' was not declared in this scope
   18 |             MinMax(a[i - 1], a[j + 1], a[i], a[j]);
      |             ^~~~~~
gap.cpp:31:9: error: 'MinMax' was not declared in this scope
   31 |         MinMax(0, 1e18, &mn, &mx);
      |         ^~~~~~