실행 실패 (제출 코드 컴파일 에러)
Main.cpp: In function ‘int main()’: Main.cpp:26:14: error: no match for ‘operator[]’ (operand types are ‘std::vector<int>’ and ‘__gnu_cxx::__normal_iterator<int*, std::vector<int> >’) 26 | v[it] = temp; | ^ In file included from /usr/include/c++/11/vector:67, from Main.cpp:2: /usr/include/c++/11/bits/stl_vector.h:1043:7: note: candidate: ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::reference = int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’ 1043 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/11/bits/stl_vector.h:1043:28: note: no known conversion for argument 1 from ‘__gnu_cxx::__normal_iterator<int*, std::vector<int> >’ to ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} 1043 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_vector.h:1061:7: note: candidate: ‘std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::const_reference = const int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’ 1061 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/11/bits/stl_vector.h:1061:28: note: no known conversion for argument 1 from ‘__gnu_cxx::__normal_iterator<int*, std::vector<int> >’ to ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} 1061 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.