Submission #1199573

#TimeUsernameProblemLanguageResultExecution timeMemory
1199573sula2Gap (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> //#include "gap.h" #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 + 2; vector<long long> a; do { MinMax(mn + 1, mx - 1, mn, mx); if (mn == -1) break; a.push_back(mn); a.push_back(mx); } while (mn != -1); 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:16:9: error: 'MinMax' was not declared in this scope
   16 |         MinMax(mn + 1, mx - 1, mn, mx);
      |         ^~~~~~