제출 #792557

#제출 시각아이디문제언어결과실행 시간메모리
792557IvanJGap (APIO16_gap)C++17
0 / 100
55 ms1108 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, lst = 0, l, r;
		while(x <= hi) {
			MinMax(x, x + min_gap - 1, &l, &r);
			if(l != -1) 
				ans = max(ans, l - lst);
			x += min_gap;
			if(r != -1) lst = r;
		}
		return ans;
	}
}

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

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