답안 #105735

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
105735 2019-04-14T09:00:04 Z Pro_ktmr Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
#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;
}

Compilation message

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++){
               ~^~~~~~~~~