실행 실패 (제출 코드 컴파일 에러)
{"stderr": "Main.cpp: In function \u2018int main()\u2019:\nMain.cpp:20:40: error: request for member \u2018ownername\u2019 in \u2018bookmap.std::map<std::__cxx11::basic_string<char>, int>::at((*(const key_type*)(& bookname.std::vector<std::__cxx11::basic_string<char> >::operator[](0))))\u2019, which is of non-class type \u2018std::map<std::__cxx11::basic_string<char>, int>::mapped_type\u2019 {aka \u2018int\u2019}\n 20 | string max = bookmap.at(bookname[0]).ownername;\n | ^~~~~~~~~\nMain.cpp:21:21: warning: comparison of integer expressions of different signedness: \u2018int\u2019 and \u2018std::map<std::__cxx11::basic_string<char>, int>::size_type\u2019 {aka \u2018long unsigned int\u2019} [-Wsign-compare]\n 21 | for (int j = 0; j < bookmap.size(); j++) {\n | ~~^~~~~~~~~~~~~~~~\nMain.cpp:22:30: error: no matching function for call to \u2018std::vector<std::__cxx11::basic_string<char> >::at(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)\u2019\n 22 | string name = bookname.at(bookname[j]).ownername;\n | ~~~~~~~~~~~^~~~~~~~~~~~~\nIn file included from /usr/include/c++/11/vector:67,\n from Main.cpp:4:\n/usr/include/c++/11/bits/stl_vector.h:1092:7: note: candidate: \u2018std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::vector<_Tp, _Alloc>::reference = std::__cxx11::basic_string<char>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]\u2019\n 1092 | at(size_type __n)\n | ^~\n/usr/include/c++/11/bits/stl_vector.h:1092:20: note: no known conversion for argument 1 from \u2018__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type\u2019 {aka \u2018std::__cxx11::basic_string<char>\u2019} to \u2018std::vector<std::__cxx11::basic_string<char> >::size_type\u2019 {aka \u2018long unsigned int\u2019}\n 1092 | at(size_type __n)\n | ~~~~~~~~~~^~~\n/usr/include/c++/11/bits/stl_vector.h:1110:7: note: candidate: \u2018std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(std::vector<_Tp, _Alloc>::size_type) const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::vector<_Tp, _Alloc>::const_reference = const std::__cxx11::basic_string<char>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]\u2019\n 1110 | at(size_type __n) const\n | ^~\n/usr/include/c++/11/bits/stl_vector.h:1110:20: note: no known conversion for argument 1 from \u2018__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type\u2019 {aka \u2018std::__cxx11::basic_string<char>\u2019} to \u2018std::vector<std::__cxx11::basic_string<char> >::size_type\u2019 {aka \u2018long unsigned int\u2019}\n 1110 | at(size_type __n) const\n | ~~~~~~~~~~^~~\nMain.cpp:23:23: error: no match for \u2018operator>\u2019 (operand types are \u2018std::map<std::__cxx11::basic_string<char>, int>::mapped_type\u2019 {aka \u2018int\u2019} and \u2018std::string\u2019 {aka \u2018std::__cxx11::basic_string<char>\u2019})\n 23 | if (bookmap[name] > max) max = name;\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:538:5: note: candidate: \u2018template<class _IteratorL, class _IteratorR> requires three_way_comparable_with<_IteratorR, _Iterator(...truncated, total 24406 characters, 1 lines)
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
비공개 코드입니다. 코드 작성자만 볼 수 있습니다.
반례를 발견하지 못했습니다.