제출 #540517

#제출 시각아이디문제언어결과실행 시간메모리
540517dutinmeowGap (APIO16_gap)C++17
0 / 100
50 ms2280 KiB
#include <bits/stdc++.h>
using namespace std;

#include "gap.h"

const long long MAX_A = 1e18;

long long findGap(int T, int N) {
	if (T == 1) {
		long long l = 1, r = MAX_A;
		vector<long long> A;
		for (int i = 0; i < (N + 1) / 2; i++) {
			long long nl, nr;
			MinMax(l, r, &nl, &nr);
			A.push_back(nl);
			A.push_back(nr);
			l = ++nl, r = --nr;
		}
		sort(A.begin(), A.end());
		long long ans = 0;
		for (int i = 1; i < N; i++)	
			ans = max(ans, A[i] - A[i - 1]);
		return ans;
	} else {

	}
}

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

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