#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 | #64107616 | Utilizator | |
| Fișier | componenteconexe.cpp | Dimensiune | 863 B |
| Data încărcării | 17 Aprilie 2026, 11:43 | Scor/rezultat | Eroare de compilare |
componenteconexe.cpp:2:1: error: ‘ifstream’ does not name a type 2 | ifstream fin("componenteconexe.in"); | ^~~~~~~~ componenteconexe.cpp:3:1: error: ‘ofstream’ does not name a type 3 | ofstream fout("componenteconexe.out"); | ^~~~~~~~ componenteconexe.cpp:5:1: error: expected unqualified-id before ‘for’ 5 | for(i=1;i<=n;i++) | ^~~ componenteconexe.cpp:5:9: error: ‘i’ does not name a type 5 | for(i=1;i<=n;i++) | ^ componenteconexe.cpp:5:14: error: ‘i’ does not name a type 5 | for(i=1;i<=n;i++) | ^ componenteconexe.cpp:8:5: error: expected unqualified-id before ‘return’ 8 | return -1; | ^~~~~~ componenteconexe.cpp:9:1: error: expected declaration before ‘}’ token 9 | } | ^ componenteconexe.cpp: In function ‘int main()’: componenteconexe.cpp:12:5: error: ‘fin’ was not declared in this scope 12 | fin>>n; | ^~~ componenteconexe.cpp:20:11: error: ‘verificare’ was not declared in this scope 20 | while(verificare(viz)!=1) | ^~~~~~~~~~ componenteconexe.cpp:21:14: error: expected ‘;’ before ‘{’ token 21 | for(i | ^ | ; 22 | {nrc++; | ~ componenteconexe.cpp:21:13: warning: statement has no effect [-Wunused-value] 21 | for(i | ^ componenteconexe.cpp:45:2: error: expected primary-expression at end of input 45 | } | ^ componenteconexe.cpp:45:2: error: expected ‘;’ at end of input 45 | } | ^ | ; componenteconexe.cpp:45:2: error: expected primary-expression at end of input componenteconexe.cpp:45:2: error: expected ‘)’ at end of input 45 | } | ^ | ) componenteconexe.cpp:21:12: note: to match this ‘(’ 21 | for(i | ^ componenteconexe.cpp:45:2: error: expected statement at end of input 45 | } | ^ componenteconexe.cpp:45:2: error: expected ‘}’ at end of input componenteconexe.cpp:11:1: note: to match this ‘{’ 11 | { | ^
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ă.