실행 실패 (제출 코드 컴파일 에러)
Main.cpp: In function ‘void merge(int&, int&, int, int, int, int)’: Main.cpp:15:25: error: invalid types ‘int[int]’ for array subscript 15 | temp_arr[i]=main_arr[B_start+main_Bcount]; | ^ Main.cpp:15:37: error: invalid types ‘int[int]’ for array subscript 15 | temp_arr[i]=main_arr[B_start+main_Bcount]; | ^ Main.cpp:19:25: error: invalid types ‘int[int]’ for array subscript 19 | temp_arr[i]=main_arr[A_start+main_Acount]; | ^ Main.cpp:19:37: error: invalid types ‘int[int]’ for array subscript 19 | temp_arr[i]=main_arr[A_start+main_Acount]; | ^ Main.cpp:22:29: error: invalid types ‘int[int]’ for array subscript 22 | else if(main_arr[A_start+main_Acount]<main_arr[B_start+main_Bcount]){ | ^ Main.cpp:22:59: error: invalid types ‘int[int]’ for array subscript 22 | else if(main_arr[A_start+main_Acount]<main_arr[B_start+main_Bcount]){ | ^ Main.cpp:23:29: error: invalid types ‘int[int]’ for array subscript 23 | temp_arr[i]=main_arr[A_start+main_Acount]; | ^ Main.cpp:23:41: error: invalid types ‘int[int]’ for array subscript 23 | temp_arr[i]=main_arr[A_start+main_Acount]; | ^ Main.cpp:27:29: error: invalid types ‘int[int]’ for array subscript 27 | else if(main_arr[A_start+main_Acount]>=main_arr[B_start+main_Bcount]){ | ^ Main.cpp:27:60: error: invalid types ‘int[int]’ for array subscript 27 | else if(main_arr[A_start+main_Acount]>=main_arr[B_start+main_Bcount]){ | ^ Main.cpp:28:29: error: invalid types ‘int[int]’ for array subscript 28 | temp_arr[i]=main_arr[B_start+main_Bcount]; | ^ Main.cpp:28:41: error: invalid types ‘int[int]’ for array subscript 28 | temp_arr[i]=main_arr[B_start+main_Bcount]; | ^ Main.cpp:6:13: warning: unused variable ‘temp_count’ [-Wunused-variable] 6 | int temp_count{}; | ^~~~~~~~~~ Main.cpp: In function ‘int main()’: Main.cpp:45:9: error: ‘i’ was not declared in this scope 45 | for(i=arr_size;i>0;i--;){ | ^ Main.cpp:45:27: error: expected ‘)’ before ‘;’ token 45 | for(i=arr_size;i>0;i--;){ | ~ ^ | ) Main.cpp:45:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 45 | for(i=arr_size;i>0;i--;){ | ^~~ Main.cpp:45:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 45 | for(i=arr_size;i>0;i--;){ | ^ Main.cpp:45:28: error: expected primary-expression before ‘)’ token Main.cpp:55:30: error: a function-definition is not allowed here before ‘{’ token 55 | void scan(int& input_arr){ | ^ Main.cpp:85:74: error: expected ‘;’ before ‘scan_arr’ 85 | merge(arr,temp_arr,0,scan_arr[0],1+1+scan_arr[0],scan_arr[i]) | ^ | ; 86 | 87 | scan_arr[0]=merge_size-2; | ~~~~~~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:71, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from Main.cpp:1: /usr/include/c++/11/bits/predefined_ops.h: In instantiation of ‘constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = int; _Iterator2 = int*; _Compare = int]’: /usr/include/c++/11/bits/stl_algo.h:4888:14: required from ‘constexpr _OutputIterator std::__merge(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) [with _InputIterator1 = int*; _InputIterator2 = int; _OutputIterator = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<int>]’ /usr/include/c++/11/bits/stl_algo.h:4997:37: required from ‘constexpr _OIter std::merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare) [with _IIter1 = int*; _IIter2 = int; _OIter = int; _Compare = int]’ Main.cpp:87:37: required from here /usr/include/c++/11/bits/predefined_ops.h:158:31: error: invalid type argument of unary ‘*’ (have ‘int’) 158 | { return bool(_M_comp(*__it1, *__it2)); } | ^~~~~~ /usr/include/c++/11/bits/predefined_ops.h:158:30: error: expression cannot be used as a function 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/string:52, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from Main.cpp:1: /usr/include/c++/11/bits/stl_algo.h: In instantiation of ‘constexpr _OutputIterator std::__merge(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) [with _InputIterator1 = int*; _InputIterator2 = int; _OutputIterator = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<int>]’: /usr/include/c++/11/bits/stl_algo.h:4997:37: required from ‘constexpr _OIter std::merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare) [with _IIter1 = int*; _IIter2 = int; _OIter = int; _Compare = int]’ Main.cpp:87:37: required from here /usr/include/c++/11/bits/stl_algo.h:4890:15: error: invalid type argument of unary ‘*’ (have ‘int’) 4890 | *__result = *__first2; | ^~~~~~~~~ /usr/include/c++/11/bits/stl_algo.h:4890:27: error: invalid type argument of unary ‘*’ (have ‘int’) 4890 | *__result = *__first2; | ^~~~~~~~~ /usr/include/c++/11/bits/stl_algo.h:4895:15: error: invalid type argument of unary ‘*’ (have ‘int’) 4895 | *__result = *__first1; | ^~~~~~~~~ In file included from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from Main.cpp:1: /usr/include/c++/11/bits/stl_algobase.h: In instantiation of ‘static constexpr _OI std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m(_II, _II, _OI) [with _II = int*; _OI = int]’: /usr/include/c++/11/bits/stl_algobase.h:492:12: required from ‘constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = int*; _OI = int]’ /usr/include/c++/11/bits/stl_algobase.h:522:42: required from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = int*; _OI = int]’ /usr/include/c++/11/bits/stl_algobase.h:530:31: required from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = int*; _OI = int]’ /usr/include/c++/11/bits/stl_algobase.h:620:7: required from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = int*; _OI = int]’ /usr/include/c++/11/bits/stl_algo.h:4901:19: required from ‘constexpr _OutputIterator std::__merge(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) [with _InputIterator1 = int*; _InputIterator2 = int; _OutputIterator = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<int>]’ /usr/include/c++/11/bits/stl_algo.h:4997:37: required from ‘constexpr _OIter std::merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare) [with _IIter1 = int*; _IIter2 = int; _OIter = int; _Compare = int]’ Main.cpp:87:37: required from here /usr/include/c++/11/bits/stl_algobase.h:385:15: error: invalid type argument of unary ‘*’ (have ‘int’) 385 | *__result = *__first; | ^~~~~~~~~ /usr/include/c++/11/bits/stl_algobase.h: In instantiation of ‘constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = int; _OI = int]’: /usr/include/c++/11/bits/stl_algobase.h:522:42: required from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = int; _OI = int]’ /usr/include/c++/11/bits/stl_algobase.h:530:31: required from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = int; _OI = int]’ /usr/include/c++/11/bits/stl_algobase.h:620:7: required from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = int; _OI = int]’ /usr/include/c++/11/bits/stl_algo.h:4900:23: required from ‘constexpr _OutputIterator std::__merge(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) [with _InputIterator1 = int*; _InputIterator2 = int; _OutputIterator = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<int>]’ /usr/include/c++/11/bits/stl_algo.h:4997:37: required from ‘constexpr _OIter std::merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare) [with _IIter1 = int*; _IIter2 = int; _OIter = int; _Compare = int]’ Main.cpp:87:37: required from here /usr/include/c++/11/bits/stl_algobase.h:488:64: error: no type named ‘iterator_category’ in ‘struct std::iterator_traits<int>’ 488 | typedef typename iterator_traits<_II>::iterator_category _Category; | ^~~~~~~~~ /usr/include/c++/11/bits/stl_algobase.h:492:19: error: no type named ‘iterator_category’ in ‘struct std::iterator_traits<int>’ 491 | return std::__copy_move<_IsMove, false, _Category>:: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 492 | __copy_m(__first, __last, __result); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/11/bits/stl_algobase.h:495:51: error: no type named ‘iterator_category’ in ‘struct std::iterator_traits<int>’ 494 | return std::__copy_move<_IsMove, __memcpyable<_OI, _II>::__value, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 495 | _Category>::__copy_m(__first, __last, __result); | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ Main.cpp:94:9: error: ‘i’ was not declared in this scope 94 | for(i=0;i<arr_size;i++;){ | ^ Main.cpp:94:27: error: expected ‘)’ before ‘;’ token 94 | for(i=0;i<arr_size;i++;){ | ~ ^ | ) Main.cpp:94:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 94 | for(i=0;i<arr_size;i++;){ | ^~~ Main.cpp:94:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 94 | for(i=0;i<arr_size;i++;){ | ^ Main.cpp:94:28: error: expected primary-expression before ‘)’ token Main.cpp:99:2: error: expected ‘}’ at end of input 99 | } | ^ Main.cpp:36:11: note: to match this ‘{’ 36 | int main(){ | ^
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.