Submission #61076

#TimeUsernameProblemLanguageResultExecution timeMemory
61076Eae02Gap (APIO16_gap)C++14
30 / 100
88 ms40044 KiB
#include "gap.h" #include <bits/stdc++.h> using ll = long long; long long findGap(int T, int N) { ll min = 0; ll max = 1000000000000000000; std::vector<ll> numbers(N); for (int i = 0; 2 * i < N; i++) { ll nextMin, nextMax; MinMax(min, max, &nextMin, &nextMax); numbers[i] = nextMin; numbers[numbers.size() - i - 1] = nextMax; min = nextMin + 1; max = nextMax - 1; } ll maxDiff = 0; for (int i = 1; i < N; i++) { maxDiff = std::max(maxDiff, numbers[i] - numbers[i - 1]); } return maxDiff; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...