Submission #744769

#TimeUsernameProblemLanguageResultExecution timeMemory
744769viwlesxqGap (APIO16_gap)C++17
30 / 100
40 ms1872 KiB
#include "gap.h" #include <bits/stdc++.h> typedef long long ll; ll Min, Max, s, t; ll findGap(int T, int N) { if (T == 1) { s = 0, t = 1e18; ll arr[N]; int l = 0, r = N - 1; while (l <= r) { MinMax(s, t, &Min, &Max); arr[l] = Min, arr[r] = Max; s = Min + 1, t = Max - 1; l++, --r; } ll ans = 0; for (int i = 1; i < N; ++i) { ans = std::max(ans, arr[i] - arr[i - 1]); } return ans; } else { return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...