Submission #1199515

#TimeUsernameProblemLanguageResultExecution timeMemory
1199515sula2Gap (APIO16_gap)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define bitcount __builtin_popcount
#define all(a) a.begin(), a.end()
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
template<typename T> using ordered_set = tree<T,null_type,less_equal<>,rb_tree_tag,tree_order_statistics_node_update>;

long long findGap(int t, int n) {
    long long mn = -1, mx = 1e18+1;
    vector<long long> a;
    while (mn != -1) {
        MinMax(mn + 1, mx - 1, mn, mx);
        if (mn == -1) break;
        a.push_back(mn);
        a.push_back(mx);
    }
    sort(all(a));
    long long res = 0;
    for (int i = 1; i < a.size(); i++)
        res = max(res, a[i] - a[i-1]);
    return res;
}

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:15:9: error: 'MinMax' was not declared in this scope
   15 |         MinMax(mn + 1, mx - 1, mn, mx);
      |         ^~~~~~