답안 #50998

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
50998 2018-06-15T14:15:50 Z Abelyan Gap (APIO16_gap) C++17
컴파일 오류
0 ms 0 KB
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
void MinMax(long long, long long, long long*, long long*);
typedef long long ll;
const ll MX=(ll)1000000000000000000;
const int MAXN=100006;
ll a[MAXN];

long long findGap(int T, int n)
{
	ll mx,mn;
	MinMax(0,MX,&mn,&mx);
	int j=n-1;
	int i=0;
	while (mn!=-1){
		a[i]=mn;
		a[j]=mx;
		//cout<<i<<" "<<" "<<j<<endl;
		//cout<<mn<< " "<<mx<<endl;
		i++;
		j--;
		if (mn+1>mx-1) break;
		MinMax(mn+1,mx-1,&mn,&mx);
		if (mn==mx && mn!=-1){
			a[i]=mn;
			break;
		}

	}
	ll maxim=0;
	for (int i=0;i<n-1;i++){
		//cout<<a[i]<<endl;
		maxim=max(maxim,a[i+1]-a[i]);
	}
	return maxim;
}

Compilation message

/tmp/cc7hhJgy.o: In function `MinMax(long long, long long, long long*, long long*)':
grader.cpp:(.text+0x0): multiple definition of `MinMax(long long, long long, long long*, long long*)'
/tmp/ccQ8t5Nu.o:gap.cpp:(.text+0x190): first defined here
/tmp/cc7hhJgy.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccQ8t5Nu.o:gap.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status