답안 #68199

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
68199 2018-08-16T08:10:53 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 = 1000000000000000000LL;

ll mn, 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;
	if(lo < mid) MinMax(lo, mid, &mn1, &mx1);
	if(mid + 1 < 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 && mx2 != mn2) r2 = solve(mn2, mx2);
	if(mx1 != -1 && mx1 != mn1) r1 = solve(mn1, mx1);
	return max({res, r1, r2});
}

long long findGap(int T, int N){
	MinMax(0, MAXA, &mn, &mx);
	return solve(mn, mx);
}

Compilation message

gap.cpp: In function 'll solve(ll, ll)':
gap.cpp:16:15: error: 'MinMax' was not declared in this scope
  if(lo < mid) MinMax(lo, mid, &mn1, &mx1);
               ^~~~~~
gap.cpp:16:15: note: suggested alternative: 'rindex'
  if(lo < mid) MinMax(lo, mid, &mn1, &mx1);
               ^~~~~~
               rindex
gap.cpp:17:19: error: 'MinMax' was not declared in this scope
  if(mid + 1 < hi) MinMax(mid + 1, hi, &mn2, &mx2);
                   ^~~~~~
gap.cpp:17:19: note: suggested alternative: 'rindex'
  if(mid + 1 < hi) MinMax(mid + 1, hi, &mn2, &mx2);
                   ^~~~~~
                   rindex
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:26:2: error: 'MinMax' was not declared in this scope
  MinMax(0, MAXA, &mn, &mx);
  ^~~~~~
gap.cpp:26:2: note: suggested alternative: 'rindex'
  MinMax(0, MAXA, &mn, &mx);
  ^~~~~~
  rindex