제출 #1325249

#제출 시각아이디문제언어결과실행 시간메모리
1325249riafhasan2010Gap (APIO16_gap)C++17
0 / 100
11 ms1180 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;
  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...