답안 #106016

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
106016 2019-04-16T08:07:20 Z OpenTheWindow Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
#include<iostream>
#include<string>
#include<set>
#include<utility>
#include<vector>
#include<map>
#include<algorithm>
#include<queue>
#include<stack>

using namespace std;

#include"gap.h"

long long findGap(int T, int N){
	
	vector<int> a;

	long long s = 0, t = 1000000000000000000;
	while (true)
	{
		int mn, mx;

		if(s > t) break;
		MinMax(s, t, &mn, &mx);

		if(mn == -1) break;

		if(mn < mx){
			a.push_back(mn);
			a.push_back(mx);

			s = mn + 1;
			t = mx - 1;
		}
		if(mn == mx){
			a.push_back(mn);
			break;
		}
	}


	sort(a.begin(), a.end());

	int ans = 0;
	for(int i=0; i<N-1; i++){
		ans = max(ans, a[i+1] - a[i]);
	}

	cout << ans << endl;


	return 0;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:25:24: error: cannot convert 'int*' to 'long long int*' for argument '3' to 'void MinMax(long long int, long long int, long long int*, long long int*)'
   MinMax(s, t, &mn, &mx);
                        ^