제출 #1084172

#제출 시각아이디문제언어결과실행 시간메모리
1084172TimoshGap (APIO16_gap)C++14
0 / 100
34 ms2172 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; #define ll long long ll findGap(int T, int n) { vector<ll> a, b; ll l = 0, r = 1e18; ll mn, mx; while (l <= r) { MinMax(l, r, &mn, &mx); if (mx == -1) break; a.push_back(mn); b.push_back(mx); l = mn + 1, r = mx - 1; } reverse(b.begin(), b.end()); ll ans = 0; int last = a[0]; for (auto &i : a) { ans = max(ans, i - last); last = i; } for (auto &i : b) { ans = max(ans, i - last); last = i; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...