실행 실패 (제출 코드 컴파일 에러)
{"stderr": "Main.cpp: In function \u2018int main()\u2019:\nMain.cpp:21:52: error: no match for \u2018operator-\u2019 (operand types are \u2018__gnu_cxx::__normal_iterator<int*, std::vector<int> >\u2019 and \u2018std::vector<int>\u2019)\n 21 | cout << lower_bound(num.begin(), num.end(), N) - num2 << \" \";\n | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~\n | | |\n | | std::vector<int>\n | __gnu_cxx::__normal_iterator<int*, std::vector<int> >\nIn file included from /usr/include/c++/11/bits/stl_algobase.h:67,\n from /usr/include/c++/11/bits/char_traits.h:39,\n from /usr/include/c++/11/ios:40,\n from /usr/include/c++/11/ostream:38,\n from /usr/include/c++/11/iostream:39,\n from Main.cpp:1:\n/usr/include/c++/11/bits/stl_iterator.h:1100:7: note: candidate: \u2018constexpr __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container>::operator-(__gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type) const [with _Iterator = int*; _Container = std::vector<int>; __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type = long int]\u2019\n 1100 | operator-(difference_type __n) const _GLIBCXX_NOEXCEPT\n | ^~~~~~~~\n/usr/include/c++/11/bits/stl_iterator.h:1100:33: note: no known conversion for argument 1 from \u2018std::vector<int>\u2019 to \u2018__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type\u2019 {aka \u2018long int\u2019}\n 1100 | operator-(difference_type __n) const _GLIBCXX_NOEXCEPT\n | ~~~~~~~~~~~~~~~~^~~\n/usr/include/c++/11/bits/stl_iterator.h:577:5: note: candidate: \u2018template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_IteratorL>&, const std::reverse_iterator<_IteratorR>&)\u2019\n 577 | operator-(const reverse_iterator<_IteratorL>& __x,\n | ^~~~~~~~\n/usr/include/c++/11/bits/stl_iterator.h:577:5: note: template argument deduction/substitution failed:\nMain.cpp:21:54: note: \u2018__gnu_cxx::__normal_iterator<int*, std::vector<int> >\u2019 is not derived from \u2018const std::reverse_iterator<_IteratorL>\u2019\n 21 | cout << lower_bound(num.begin(), num.end(), N) - num2 << \" \";\n | ^~~~\nIn file included from /usr/include/c++/11/bits/stl_algobase.h:67,\n from /usr/include/c++/11/bits/char_traits.h:39,\n from /usr/include/c++/11/ios:40,\n from /usr/include/c++/11/ostream:38,\n from /usr/include/c++/11/iostream:39,\n from Main.cpp:1:\n/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: candidate: \u2018template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)\u2019\n 1693 | operator-(const move_iterator<_IteratorL>& __x,\n | ^~~~~~~~\n/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: template argument deduction/substitution failed:\nMain.cpp:21:54: note: \u2018__gnu_cxx::__normal_iterator<int*, std::vector<int> >\u2019 is not derived from \u2018const std::move_iterator<_IteratorL>\u2019\n 21 | cout << lower_bound(num.begin(), num.end(), N) - num2 << \" \";\n | ^~~~\nIn file included from /usr/include/c++/11/bits/stl_algobase.h:67,\n from /usr/include/c++/11/bits/char_traits.h:39,\n from /usr/include/c++/11/ios:40,\n from /usr/include/c++/11/ostream:38,\n from /usr/include/c++/11/iostream:39,\n from Main.cpp:1:\n/usr/include/c(...truncated, total 7654 characters)
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.