실행 실패 (제출 코드 컴파일 에러)
{"stderr": "Main.cpp: In function \u2018int main()\u2019:\nMain.cpp:21:17: error: no matching function for call to \u2018begin(std::stack<int>&)\u2019\n 21 | for(auto &p : s){\n | ^\nIn file included from /usr/include/c++/11/bits/algorithmfwd.h:39,\n from /usr/include/c++/11/bits/stl_algo.h:60,\n from /usr/include/c++/11/string:52,\n from /usr/include/c++/11/bits/locale_classes.h:40,\n from /usr/include/c++/11/bits/ios_base.h:41,\n from /usr/include/c++/11/ios:42,\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/initializer_list:90:5: note: candidate: \u2018template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)\u2019\n 90 | begin(initializer_list<_Tp> __ils) noexcept\n | ^~~~~\n/usr/include/c++/11/initializer_list:90:5: note: template argument deduction/substitution failed:\nMain.cpp:21:17: note: \u2018std::stack<int>\u2019 is not derived from \u2018std::initializer_list<_Tp>\u2019\n 21 | for(auto &p : s){\n | ^\nIn file included from /usr/include/c++/11/string:54,\n from /usr/include/c++/11/bits/locale_classes.h:40,\n from /usr/include/c++/11/bits/ios_base.h:41,\n from /usr/include/c++/11/ios:42,\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/range_access.h:51:5: note: candidate: \u2018template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)\u2019\n 51 | begin(_Container& __cont) -> decltype(__cont.begin())\n | ^~~~~\n/usr/include/c++/11/bits/range_access.h:51:5: note: template argument deduction/substitution failed:\n/usr/include/c++/11/bits/range_access.h: In substitution of \u2018template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::stack<int>]\u2019:\nMain.cpp:21:17: required from here\n/usr/include/c++/11/bits/range_access.h:51:50: error: \u2018class std::stack<int>\u2019 has no member named \u2018begin\u2019\n 51 | begin(_Container& __cont) -> decltype(__cont.begin())\n | ~~~~~~~^~~~~\n/usr/include/c++/11/bits/range_access.h:61:5: note: candidate: \u2018template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)\u2019\n 61 | begin(const _Container& __cont) -> decltype(__cont.begin())\n | ^~~~~\n/usr/include/c++/11/bits/range_access.h:61:5: note: template argument deduction/substitution failed:\n/usr/include/c++/11/bits/range_access.h: In substitution of \u2018template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&) [with _Container = std::stack<int>]\u2019:\nMain.cpp:21:17: required from here\n/usr/include/c++/11/bits/range_access.h:61:56: error: \u2018const class std::stack<int>\u2019 has no member named \u2018begin\u2019\n 61 | begin(const _Container& __cont) -> decltype(__cont.begin())\n | ~~~~~~~^~~~~\n/usr/include/c++/11/bits/range_access.h:90:5: note: candidate: \u2018template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])\u2019\n 90 | begin(_Tp (&__arr)[_Nm]) noexcept\n | ^~~~~\n/usr/include/c++/11/bits/range_access.h:90:5: note: template argument deduction/substitution failed:\nMain.cpp:21:17: note: mismatched types \u2018_Tp [_Nm]\u2019 and \u2018std::stack<int>\u2019\n 21 | for(auto &p : s){\n | ^\nIn file included from /usr/include/c++/11/string:54,\n from /usr/include/c++/11/bits/locale_classes.h:40,\n from /usr/include/c++/11/bits/ios_base.h:41,\n (...truncated, total 11111 characters)
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.