#2282
ComponenteConexe4
Se consideră un graf neorientat cu n
vârfuri și m
muchii. Cele m
muchii se elimină pe rând din graf. Pentru fiecare muchie eliminată trebuie să spuneți câte componente conexe are graful.
Problema | ComponenteConexe4 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51998114 | Utilizator | |
Fișier | componenteconexe4.cpp | Dimensiune | 1.39 KB |
Data încărcării | 15 Septembrie 2024, 14:54 | Scor / rezultat | Eroare de compilare |
componenteconexe4.cpp: In function 'bool union_sets(int, int)': componenteconexe4.cpp:21:9: error: reference to 'rank' is ambiguous if (rank[a] < rank[b]) ^ componenteconexe4.cpp:8:19: note: candidates are: int rank [100005] int parent[MAXN], rank[MAXN]; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from componenteconexe4.cpp:1: /usr/include/c++/4.8/type_traits:1243:12: note: template<class> struct std::rank struct rank ^ componenteconexe4.cpp:21:19: error: reference to 'rank' is ambiguous if (rank[a] < rank[b]) ^ componenteconexe4.cpp:8:19: note: candidates are: int rank [100005] int parent[MAXN], rank[MAXN]; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from componenteconexe4.cpp:1: /usr/include/c++/4.8/type_traits:1243:12: note: template<class> struct std::rank struct rank ^ componenteconexe4.cpp:24:9: error: reference to 'rank' is ambiguous if (rank[a] == rank[b]) ^ componenteconexe4.cpp:8:19: note: candidates are: int rank [100005] int parent[MAXN], rank[MAXN]; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from componenteconexe4.cpp:1: /usr/include/c++/4.8/type_traits:1243:12: note: template<class> struct std::rank struct rank ^ componenteconexe4.cpp:24:20: error: reference to 'rank' is ambiguous if (rank[a] == rank[b]) ^ componenteconexe4.cpp:8:19: note: candidates are: int rank [100005] int parent[MAXN], rank[MAXN]; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from componenteconexe4.cpp:1: /usr/include/c++/4.8/type_traits:1243:12: note: template<class> struct std::rank struct rank ^ componenteconexe4.cpp:25:9: error: reference to 'rank' is ambiguous rank[a]++; ^ componenteconexe4.cpp:8:19: note: candidates are: int rank [100005] int parent[MAXN], rank[MAXN]; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from componenteconexe4.cpp:1: /usr/include/c++/4.8/type_traits:1243:12: note: template<class> struct std::rank struct rank ^ componenteconexe4.cpp: In function 'int main()': componenteconexe4.cpp:45:9: error: reference to 'rank' is ambiguous rank[i] = 0; ^ componenteconexe4.cpp:8:19: note: candidates are: int rank [100005] int parent[MAXN], rank[MAXN]; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from componenteconexe4.cpp:1: /usr/include/c++/4.8/type_traits:1243:12: note: template<class> struct std::rank struct rank ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe4 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.