답안 #68191

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
68191 2018-08-16T07:57:49 Z gusfring Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "gap.h"

using namespace std;

typedef long long ll;
const int MAXN = 1e5 + 5;
const ll MAXA = 1000000000000000000LLU;

ll mn, mx;

void MinMax(ll s, ll t, ll &mn, ll &mx);
	
ll solve(ll lo, ll hi){
	if(lo >= hi) return 0;
	unsigned long long x = (1LLU * lo + hi) / 2;
	ll mid = (ll)(x), mn1 = -1, mx1 = -1, mn2 = -1, mx2 = -1;
	MinMax(lo, mid, mn1, mx1);
	if(mid < hi) MinMax(mid + 1, hi, mn2, mx2);
	ll res = 0, r1 = 0, r2 = 0;
	if(mx1 != -1 && mx2 != -1) res = mn2 - mx1;
	if(mx2 != -1) r2 = solve(mid + 1, hi);
	if(mx1 != -1) r1 = solve(lo, mid);
	return max({res, r1, r2});
}

long long findGap(int T, int N){
	return solve(0, MAXA);
}

Compilation message

/tmp/cc0UsBSp.o: In function `solve(long long, long long) [clone .part.4]':
gap.cpp:(.text+0x70): undefined reference to `MinMax(long long, long long, long long&, long long&)'
gap.cpp:(.text+0x11a): undefined reference to `MinMax(long long, long long, long long&, long long&)'
collect2: error: ld returned 1 exit status