Submission #133228

#TimeUsernameProblemLanguageResultExecution timeMemory
133228mlyean00Gap (APIO16_gap)C++14
30 / 100
58 ms3092 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; using ll = long long; ll findGap(int T, int N) { ll ans = 0; ll mn, mx; MinMax(0, 1'000'000'000'000'000'000LL, &mn, &mx); for (int i = 1; i < (N + 1) / 2; ++i) { ll mn2, mx2; MinMax(mn + 1, mx - 1, &mn2, &mx2); ans = max({ans, mn2 - mn, mx - mx2}); mn = mn2; mx = mx2; } ans = max(ans, mx - mn); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...