답안 #101635

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
101635 2019-03-19T05:42:39 Z asifthegreat Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define int long long
#define all(a) a.begin(),a.end() 

using namespace std;

vector<int>v;

long long findGap(int32_t T,int32_t n)
{
	v.clear();
	if(T == 1){
		int s = 0,t = 1000000000000000001,mn,mx,sz = 0;
		while(1){
			if(sz >= n)break;
			MinMax(s,t,&mn,&mx);
			v.push_back(mn);
			if(mn != mx){v.push_back(mx);sz++;}
			s = mn+1;
			t = mx-1;
			sz++;
		}
		sort(all(v));
		int ans = -1;
		for(int i = 1; i < n;i++){
			ans = max(ans,v[i]-v[i-1]);
		}
		return ans;
	}
	else return 0;
}

Compilation message

gap.cpp: In function 'long long int findGap(int32_t, int32_t)':
gap.cpp:16:4: error: 'MinMax' was not declared in this scope
    MinMax(s,t,&mn,&mx);
    ^~~~~~
gap.cpp:16:4: note: suggested alternative: 'rindex'
    MinMax(s,t,&mn,&mx);
    ^~~~~~
    rindex