제출 #401657

#제출 시각아이디문제언어결과실행 시간메모리
401657BERNARB01Gap (APIO16_gap)C++17
30 / 100
55 ms1884 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long findGap(int T, int N) { long long lb = 0, rb = (long long) 1e18L; int l = 0, r = N - 1; vector<long long> a(N); while (l <= r) { MinMax(lb, rb, &a[l], &a[r]); lb = a[l++] + 1; rb = a[r--] - 1; } long long ans = 0; for (int i = 1; i < N; i++) { ans = max(ans, a[i] - a[i - 1]); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...