제출 #105735

#제출 시각아이디문제언어결과실행 시간메모리
105735Pro_ktmrGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define PB push_back
#define MP make_pair
#define MOD 1000000007

//MinMax(LL s, LL t, LL& mn, LL& mx)
//aiのうちs以上の最小の数がmnに、aiのうちt以下の最大値がmxに格納される

//aiの差分のうち最大のものを返す
LL findGap(int T, int N){
	LL m = 0LL;
	LL M = 1000000000000000000LL;
	vector<LL> v;
	for(int i=0; i<(N+1)/2; i++){
		LL tmp1, tmp2;
		MinMax(m, M, tmp1, tmp2);
		v.PB(tmp1);
		v.PB(tmp2);
		m = tmp1+1;
		M = tmp2-1;
	}
	sort(v.begin(), v.end());

	LL ans = 0;
	for(int i=1; i<v.size(); i++){
		ans = max(ans, v[i] - v[i-1]);
	}
	return ans;
}

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:19:3: error: 'MinMax' was not declared in this scope
   MinMax(m, M, tmp1, tmp2);
   ^~~~~~
gap.cpp:19:3: note: suggested alternative: 'rindex'
   MinMax(m, M, tmp1, tmp2);
   ^~~~~~
   rindex
gap.cpp:28:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1; i<v.size(); i++){
               ~^~~~~~~~~