제출 #1325250

#제출 시각아이디문제언어결과실행 시간메모리
1325250riafhasan2010Gap (APIO16_gap)C++17
70 / 100
46 ms1204 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; long long findGap(int t, int n) { ll first, last, l = 0, ans = 0; MinMax(l, 1e18, &first, &last); ll dif = (last - first + n - 2) / (n - 1); ans = dif; l = first; for (ll i = l + 1; i < last; i += dif + 1) { ll mn, mx; MinMax(i, min(i + dif, last - 1), &mn, &mx); if (mn == -1) continue; ans = max(ans, mn - l); l = mx; } ans = max(ans, last - l); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...