Submission #1182647

#TimeUsernameProblemLanguageResultExecution timeMemory
1182647SulAGap (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;

long long findGap(int t, int n) {
    long long l = -1, r = 1e18+1, mn, mx;
    vector<long long> a;
    while (l <= r) {
        MinMax(l, r, mn, mx);
        a.push_back(mn);
        a.push_back(mx);
        l = mn + 1;
        r = mx - 1;
    }
    sort(all(a));
    long long ans = 0;
    for (int i = 0; i+1 < a.size(); i++)
        ans = max(ans, a[i+1] - a[i]);
    cout << ans;
}

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:14:9: error: 'MinMax' was not declared in this scope
   14 |         MinMax(l, r, mn, mx);
      |         ^~~~~~
gap.cpp:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
   25 | }
      | ^