Submission #585285

#TimeUsernameProblemLanguageResultExecution timeMemory
585285Do_you_copyGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define taskname "test" #define fi first #define se second #define pb push_back #define faster ios_base::sync_with_stdio(0); cin.tie(0); using namespace std; using ll = long long; using pii = pair <int, int>; ll min(const ll &a, const ll &b){ return (a < b) ? a : b; } ll max(const ll &a, const ll &b){ return (a > b) ? a : b; } const ll Mod = 1000000007; const int maxN = 1e5 + 1; const ll inf = LLONG_MAX; int n; ll a[maxN]; ll findGap(int T, long int N){ if (T & 1){ ll mn, mx; MinMax(0, inf, &mn, &mx); a[1] = mn, a[N] = mx; for (int i = 2; i <= (N + 1) / 2; ++i){ MinMax(mn + 1, mx - 1, &mn, &mx); a[i] = mn, a[N - i + 1] = mx; } ll ans = 0; for (int i = 2; i <= N; ++i){ ans = max(ans, a[i] - a[i - 1]); } return ans; } else{ ll mn, mx; MinMax(0, inf, &mn, &mx); ll ans = 0, i = mn, last = LLONG_MAX; int j = (mx - mn) / (N - 1); for (; i <= mx; i += j){ ll x, y; MinMax(i, i + j, &x, &y); ans = max(ans, x - last); last = y; } return ans; } }

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, long int)':
gap.cpp:29:9: error: 'MinMax' was not declared in this scope
   29 |         MinMax(0, inf, &mn, &mx);
      |         ^~~~~~
gap.cpp:43:9: error: 'MinMax' was not declared in this scope
   43 |         MinMax(0, inf, &mn, &mx);
      |         ^~~~~~