제출 #792569

#제출 시각아이디문제언어결과실행 시간메모리
792569IvanJGap (APIO16_gap)C++17
70 / 100
47 ms1104 KiB
#include "gap.h" #include<bits/stdc++.h> #define pb push_back #define x first #define y second #define all(a) (a).begin(), (a).end() using namespace std; typedef long long ll; typedef pair<int, int> ii; ll findGap(int T, int N) { if(T == 1) { return 0; } if(T == 2) { ll lo = 0, hi = 1e18; MinMax(lo, hi, &lo, &hi); ll min_gap = (hi - lo) / ((ll)N - 1); ll ans = 0; ll x = lo + 1, lst = lo, l, r; while(x < hi) { MinMax(x, x + min_gap, &l, &r); if(l != -1) ans = max(ans, l - lst); x += min_gap + 1; if(r != -1) lst = r; } if(x == hi) ans = max(ans, hi - lst); return ans; } }

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

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
   35 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...