답안 #149762

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
149762 2019-09-01T07:07:14 Z (παρα)γεμιστά(#3619, cfalas, ctziapo, Charis02) 십자가 놓기 (FXCUP4_cross) C++17
컴파일 오류
0 ms 0 KB
#include "cross.h"

long long SelectCross(int K, std::vector<int> I, std::vector<int> O) {
	int N = I.size();
	long long ans=0;
	for(int i=0;i<N;i++){
		ans = max(ans, O[i]*O[i] - 2*O[i]*I[i] );
	}

	return ans;
}

Compilation message

cross.cpp: In function 'long long int SelectCross(int, std::vector<int>, std::vector<int>)':
cross.cpp:7:9: error: 'max' was not declared in this scope
   ans = max(ans, O[i]*O[i] - 2*O[i]*I[i] );
         ^~~
cross.cpp:7:9: note: suggested alternative:
In file included from /usr/include/c++/7/vector:60:0,
                 from cross.h:2,
                 from cross.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:265:5: note:   'std::max'
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~