#438
Se dă lista muchiilor unui graf neorientat. Să se afișeze componentele conexe ale acestui graf.
| Problema | ComponenteConexe | Operații I/O |
componenteconexe.in/componenteconexe.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64493608 | Utilizator | |
| Fișier | componenteconexe.cpp | Dimensiune | 735 B |
| Data încărcării | 11 Mai 2026, 09:44 | Scor/rezultat | Eroare de compilare |
componenteconexe.cpp: In function ‘void dfs(int)’: componenteconexe.cpp:17:12: error: ‘nrc’ was not declared in this scope 17 | viz[x]=nrc; | ^~~ componenteconexe.cpp: In function ‘int main()’: componenteconexe.cpp:32:13: error: ‘cnt’ was not declared in this scope; did you mean ‘int’? 32 | cnt++; | ^~~ | int componenteconexe.cpp:36:5: error: ‘cout’ was not declared in this scope 36 | cout<<nrc; | ^~~~ componenteconexe.cpp:2:1: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? 1 | #include <fstream> +++ |+#include <iostream> 2 | using namespace std; componenteconexe.cpp:39:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 39 | for(int j=1;j<=n;j++) | ^~~ componenteconexe.cpp:41:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 41 | fout<<endl; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe 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ă.