# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
234229 | AASG | 말 (IOI15_horses) | C++14 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
int init(int N, int X[], int Y[]) {
int V[N];
V[0]=X[0];
int mx=0;
for(int i=1;i<N;i++)V[i]=V[i-1]*X[i];
for(int i=0;i<N;i++)mx=max(V[i]*Y[i]);
return mx;
}
int updateX(int pos, int val) {
return 0;
}
int updateY(int pos, int val) {
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
horses.cpp: In function 'int init(int, int*, int*)': horses.cpp:10:41: error: no matching function for call to 'max(int)' for(int i=0;i<N;i++)mx=max(V[i]*Y[i]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from horses.cpp:2: /usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^~~ /usr/include/c++/7/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed: horses.cpp:10:41: note: candidate expects 2 arguments, 1 provided for(int i=0;i<N;i++)mx=max(V[i]*Y[i]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from horses.cpp:2: /usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed: horses.cpp:10:41: note: candidate expects 3 arguments, 1 provided for(int i=0;i<N;i++)mx=max(V[i]*Y[i]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from horses.cpp:2: /usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^~~ /usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed: horses.cpp:10:41: note: mismatched types 'std::initializer_list<_Tp>' and 'int' for(int i=0;i<N;i++)mx=max(V[i]*Y[i]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from horses.cpp:2: /usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed: horses.cpp:10:41: note: mismatched types 'std::initializer_list<_Tp>' and 'int' for(int i=0;i<N;i++)mx=max(V[i]*Y[i]); ^ horses.cpp: In function 'int updateX(int, int)': horses.cpp:14:17: warning: unused parameter 'pos' [-Wunused-parameter] int updateX(int pos, int val) { ^~~ horses.cpp:14:26: warning: unused parameter 'val' [-Wunused-parameter] int updateX(int pos, int val) { ^~~ horses.cpp: In function 'int updateY(int, int)': horses.cpp:18:17: warning: unused parameter 'pos' [-Wunused-parameter] int updateY(int pos, int val) { ^~~ horses.cpp:18:26: warning: unused parameter 'val' [-Wunused-parameter] int updateY(int pos, int val) { ^~~