실행 실패 (제출 코드 컴파일 에러)
Main.cpp: In function ‘bool unify(int, int)’: Main.cpp:32:9: error: reference to ‘rank’ is ambiguous 32 | if (rank[x] >= rank[y]) | ^~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/deque:60, from /usr/include/c++/11/queue:60, from Main.cpp:2: /usr/include/c++/11/type_traits:1369:12: note: candidates are: ‘template<class> struct std::rank’ 1369 | struct rank | ^~~~ Main.cpp:12:5: note: ‘int rank [10001]’ 12 | int rank[10001] = { 0 }; | ^~~~ Main.cpp:32:20: error: reference to ‘rank’ is ambiguous 32 | if (rank[x] >= rank[y]) | ^~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/deque:60, from /usr/include/c++/11/queue:60, from Main.cpp:2: /usr/include/c++/11/type_traits:1369:12: note: candidates are: ‘template<class> struct std::rank’ 1369 | struct rank | ^~~~ Main.cpp:12:5: note: ‘int rank [10001]’ 12 | int rank[10001] = { 0 }; | ^~~~ Main.cpp:37:9: error: reference to ‘rank’ is ambiguous 37 | if (rank[x] == rank[y]) | ^~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/deque:60, from /usr/include/c++/11/queue:60, from Main.cpp:2: /usr/include/c++/11/type_traits:1369:12: note: candidates are: ‘template<class> struct std::rank’ 1369 | struct rank | ^~~~ Main.cpp:12:5: note: ‘int rank [10001]’ 12 | int rank[10001] = { 0 }; | ^~~~ Main.cpp:37:20: error: reference to ‘rank’ is ambiguous 37 | if (rank[x] == rank[y]) | ^~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/deque:60, from /usr/include/c++/11/queue:60, from Main.cpp:2: /usr/include/c++/11/type_traits:1369:12: note: candidates are: ‘template<class> struct std::rank’ 1369 | struct rank | ^~~~ Main.cpp:12:5: note: ‘int rank [10001]’ 12 | int rank[10001] = { 0 }; | ^~~~ Main.cpp:38:9: error: reference to ‘rank’ is ambiguous 38 | rank[y] = rank[x] + 1; | ^~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/deque:60, from /usr/include/c++/11/queue:60, from Main.cpp:2: /usr/include/c++/11/type_traits:1369:12: note: candidates are: ‘template<class> struct std::rank’ 1369 | struct rank | ^~~~ Main.cpp:12:5: note: ‘int rank [10001]’ 12 | int rank[10001] = { 0 }; | ^~~~ Main.cpp:38:19: error: reference to ‘rank’ is ambiguous 38 | rank[y] = rank[x] + 1; | ^~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/deque:60, from /usr/include/c++/11/queue:60, from Main.cpp:2: /usr/include/c++/11/type_traits:1369:12: note: candidates are: ‘template<class> struct std::rank’ 1369 | struct rank | ^~~~ Main.cpp:12:5: note: ‘int rank [10001]’ 12 | int rank[10001] = { 0 }; | ^~~~ Main.cpp: In function ‘int main()’: Main.cpp:50:9: error: reference to ‘rank’ is ambiguous 50 | rank[i] = 0; | ^~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/deque:60, from /usr/include/c++/11/queue:60, from Main.cpp:2: /usr/include/c++/11/type_traits:1369:12: note: candidates are: ‘template<class> struct std::rank’ 1369 | struct rank | ^~~~ Main.cpp:12:5: note: ‘int rank [10001]’ 12 | int rank[10001] = { 0 }; | ^~~~ Main.cpp:45:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 45 | scanf("%d %d",&v,&e); | ~~~~~^~~~~~~~~~~~~~~ Main.cpp:58:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 58 | scanf("%d %d %d",&a,&b,&c); | ~~~~~^~~~~~~~~~~~~~~~~~~~~
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.