제출 #1325248

#제출 시각아이디문제언어결과실행 시간메모리
1325248riafhasan2010Gap (APIO16_gap)C++17
컴파일 에러
0 ms0 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, r, &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;
}

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:8:13: error: 'r' was not declared in this scope
    8 |   MinMax(l, r, &first, &last);
      |             ^