#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 | #64662472 | Utilizator | |
| Fișier | componenteconexe.cpp | Dimensiune | 1.04 KB |
| Data încărcării | 21 Mai 2026, 10:10 | Scor/rezultat | Eroare de compilare |
componenteconexe.cpp:3:1: error: ‘ifstream’ does not name a type 3 | ifstream fin("componenteconexe.in"); | ^~~~~~~~ componenteconexe.cpp:4:1: error: ‘ofstream’ does not name a type 4 | ofstream fout("componenteconexe.out"); | ^~~~~~~~ componenteconexe.cpp: In function ‘int main()’: componenteconexe.cpp:26:5: error: ‘fin’ was not declared in this scope 26 | fin>>n; | ^~~ componenteconexe.cpp:35:14: error: expected ‘)’ before ‘}’ token 35 | dfs(i}; | ~ ^ | ) componenteconexe.cpp: At global scope: componenteconexe.cpp:37:13: error: expected declaration before ‘}’ token 37 | } | ^ componenteconexe.cpp:38:13: error: ‘fout’ does not name a type 38 | fout<<nrc<<'\n'; | ^~~~ componenteconexe.cpp:40:13: error: expected unqualified-id before ‘for’ 40 | for(int c=1;c<=nrc;c++) | ^~~ componenteconexe.cpp:40:25: error: ‘c’ does not name a type 40 | for(int c=1;c<=nrc;c++) | ^ componenteconexe.cpp:40:32: error: ‘c’ does not name a type 40 | for(int c=1;c<=nrc;c++) | ^ componenteconexe.cpp:49:13: error: expected unqualified-id before ‘return’ 49 | return 0; | ^~~~~~ componenteconexe.cpp:50:13: error: expected declaration before ‘}’ token 50 | } | ^
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ă.