# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
804645 | oviyan_gandhi | Best Place (NOI17_bestplace) | C++14 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
int x[n], y[n];
for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
cout << accumulate(x, x+n)/n << ' ' << accumulate(y, y+n)/n << '\n';
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
bestplace.cpp: In function 'int main()': bestplace.cpp:8:28: error: no matching function for call to 'accumulate(int [n], int*)' 8 | cout << accumulate(x, x+n)/n << ' ' << accumulate(y, y+n)/n << '\n'; | ^ In file included from /usr/include/c++/10/numeric:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:84, from bestplace.cpp:1: /usr/include/c++/10/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)' 134 | accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) | ^~~~~~~~~~ /usr/include/c++/10/bits/stl_numeric.h:134:5: note: template argument deduction/substitution failed: bestplace.cpp:8:28: note: candidate expects 3 arguments, 2 provided 8 | cout << accumulate(x, x+n)/n << ' ' << accumulate(y, y+n)/n << '\n'; | ^ In file included from /usr/include/c++/10/numeric:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:84, from bestplace.cpp:1: /usr/include/c++/10/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)' 161 | accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, | ^~~~~~~~~~ /usr/include/c++/10/bits/stl_numeric.h:161:5: note: template argument deduction/substitution failed: bestplace.cpp:8:28: note: candidate expects 4 arguments, 2 provided 8 | cout << accumulate(x, x+n)/n << ' ' << accumulate(y, y+n)/n << '\n'; | ^ bestplace.cpp:8:59: error: no matching function for call to 'accumulate(int [n], int*)' 8 | cout << accumulate(x, x+n)/n << ' ' << accumulate(y, y+n)/n << '\n'; | ^ In file included from /usr/include/c++/10/numeric:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:84, from bestplace.cpp:1: /usr/include/c++/10/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)' 134 | accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) | ^~~~~~~~~~ /usr/include/c++/10/bits/stl_numeric.h:134:5: note: template argument deduction/substitution failed: bestplace.cpp:8:59: note: candidate expects 3 arguments, 2 provided 8 | cout << accumulate(x, x+n)/n << ' ' << accumulate(y, y+n)/n << '\n'; | ^ In file included from /usr/include/c++/10/numeric:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:84, from bestplace.cpp:1: /usr/include/c++/10/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)' 161 | accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, | ^~~~~~~~~~ /usr/include/c++/10/bits/stl_numeric.h:161:5: note: template argument deduction/substitution failed: bestplace.cpp:8:59: note: candidate expects 4 arguments, 2 provided 8 | cout << accumulate(x, x+n)/n << ' ' << accumulate(y, y+n)/n << '\n'; | ^