제출 #288988

#제출 시각아이디문제언어결과실행 시간메모리
288988shrek12357Gap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <climits>
#include <cmath>
#include <fstream>
#include <queue>
#include "gap.h"
using namespace std;
 
long long findGap(int t, int n){
	if (t == 2) {
		return 0;
	}
	long long max = 1e18 + 1;
	long long pre = 0;
	long long ans = 0;
	for (int i = 0; i < n; i++) {
      	long long mn, mx;
		MinMax(1, max, &mn, &mx);
		if (i == 0) {
			pre = mx;
		}
		else {
			ans = max(ans, pre - mx);
			pre = mx;
		}
	}
	return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:28:27: error: 'max' cannot be used as a function
   28 |    ans = max(ans, pre - mx);
      |                           ^