#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 | #63178426 | Utilizator | |
| Fișier | componenteconexe6.cpp | Dimensiune | 818 B |
| Data încărcării | 19 Februarie 2026, 09:51 | Scor/rezultat | Eroare de compilare |
componenteconexe6.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream cout("componenteconexe6.out") ^ componenteconexe6.cpp: In function 'int vizitat()': componenteconexe6.cpp:11:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe6.cpp:11:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe6.cpp:12:12: error: 'v' was not declared in this scope if(v[i]==0) ^ componenteconexe6.cpp: In function 'void dfs(int)': componenteconexe6.cpp:19:5: error: 'v' was not declared in this scope v[k]=c; ^ componenteconexe6.cpp:19:10: error: 'c' was not declared in this scope v[k]=c; ^ componenteconexe6.cpp:20:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe6.cpp:20:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe6.cpp:21:23: error: 'a' was not declared in this scope if(v[i]==0 && a[i][k]==1) ^ componenteconexe6.cpp: In function 'int main()': componenteconexe6.cpp:27:10: error: 'n' was not declared in this scope cin>>n; ^ componenteconexe6.cpp:28:16: error: 'i' was not declared in this scope while(cin>>i>>j) ^ componenteconexe6.cpp:28:19: error: 'j' was not declared in this scope while(cin>>i>>j) ^ componenteconexe6.cpp:30:9: error: 'a' was not declared in this scope a[i][j]=1; ^ componenteconexe6.cpp:33:9: error: 'x' was not declared in this scope x=vizitat(); ^ componenteconexe6.cpp:36:13: error: 'c' was not declared in this scope c++; ^ componenteconexe6.cpp:40:9: error: 'cout' was not declared in this scope cout<<c<<endl; ^ componenteconexe6.cpp:40:15: error: 'c' was not declared in this scope cout<<c<<endl; ^ componenteconexe6.cpp:41:13: error: 'i' was not declared in this scope for(i=1;i<=c;i++){ ^ componenteconexe6.cpp:42:17: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ componenteconexe6.cpp:43:18: error: 'v' was not declared in this scope if(v[j]==i) ^
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ă.