#4781
Se dă lista muchiilor unui graf neorientat. Să se afișeze componentele conexe ale acestui graf.
| Problema | ComponenteConexe6 | Operații I/O |
componenteconexe6.in/componenteconexe6.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63505126 | Utilizator | |
| Fișier | componenteconexe6.cpp | Dimensiune | 859 B |
| Data încărcării | 06 Martie 2026, 09:14 | Scor/rezultat | Eroare de compilare |
componenteconexe6.cpp:5:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("componenteconexe6.in"); ^ componenteconexe6.cpp:6:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("componenteconexe6.out"); ^ componenteconexe6.cpp: In function 'int main()': componenteconexe6.cpp:29:5: error: reference to 'cin' is ambiguous cin>>n; ^ componenteconexe6.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("componenteconexe6.in"); ^ In file included from componenteconexe6.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ componenteconexe6.cpp:30:11: error: reference to 'cin' is ambiguous while(cin>>x>>y) ^ componenteconexe6.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("componenteconexe6.in"); ^ In file included from componenteconexe6.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ componenteconexe6.cpp:36:14: warning: pointer to a function used in arithmetic [-Wpointer-arith] bfs[i]; ^ componenteconexe6.cpp:36:14: warning: value computed is not used [-Wunused-value] componenteconexe6.cpp:36:14: warning: statement has no effect [-Wunused-value] componenteconexe6.cpp:38:5: error: reference to 'cout' is ambiguous cout<<nc<<'\n'; ^ componenteconexe6.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("componenteconexe6.out"); ^ In file included from componenteconexe6.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ componenteconexe6.cpp:43:13: error: reference to 'cout' is ambiguous cout<<j<<" "; ^ componenteconexe6.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("componenteconexe6.out"); ^ In file included from componenteconexe6.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ componenteconexe6.cpp:44:9: error: reference to 'cout' is ambiguous cout<<'\n'; ^ componenteconexe6.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("componenteconexe6.out"); ^ In file included from componenteconexe6.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe6 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ă.