이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <bits/stdc++.h>
template<typename T>
bool chmax(T &a, T b) { 
	if (a >= b)
		return false;
	a = b;
	return true;
}
long long findGap(int t, int n) {
	if (t == 1) {
		std::vector<long long> a;
		a.reserve(n);
		long long bl = 0, br = 1e18;
		for (int i = 0; i < (n + 1) / 2; i++) {
			long long al, ar;
			MinMax(bl, br, &al, &ar);
			a.push_back(al);
			a.push_back(ar);
			bl = al + 1, br = br - 1;
		}
		std::sort(a.begin(), a.end());
		long long r = 0;
		for (int i = 1; i < n; i++)
			chmax(r, a[i] - a[i - 1]);
		return r;
	} else {
	}
}
컴파일 시 표준 에러 (stderr) 메시지
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |