#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 | #58398627 | Utilizator | |
Fișier | componenteconexe.cpp | Dimensiune | 828 B |
Data încărcării | 01 Iunie 2025, 19:10 | Scor / rezultat | Eroare de compilare |
componenteconexe.cpp:8:1: error: expected ',' or ';' before 'ofstream' ofstream fout("componenteconexe.out") ^ componenteconexe.cpp: In function 'void bfs(int)': componenteconexe.cpp:14:5: error: 'viz' was not declared in this scope viz[start] = 1; ^ componenteconexe.cpp:15:5: error: 'coada' was not declared in this scope coada[1]=start; ^ componenteconexe.cpp:16:5: error: 'st' was not declared in this scope st=1; ^ componenteconexe.cpp:17:5: error: 'dr' was not declared in this scope dr=1; ^ componenteconexe.cpp:18:5: error: 'fout' was not declared in this scope fout<<start<<" "; ^ componenteconexe.cpp:22:13: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ componenteconexe.cpp:22:21: error: 'n' was not declared in this scope for(i=1; i<=n; i++) ^ componenteconexe.cpp:23:16: error: 'a' was not declared in this scope if(a[i][nod_curent] == 1 && viz[i] == 0) ^ componenteconexe.cpp: In function 'int main()': componenteconexe.cpp:36:10: error: 'n' was not declared in this scope fin>>n>>m>>k; ^ componenteconexe.cpp:36:13: error: 'm' was not declared in this scope fin>>n>>m>>k; ^ componenteconexe.cpp:36:16: error: 'k' was not declared in this scope fin>>n>>m>>k; ^ componenteconexe.cpp:37:9: error: 'i' was not declared in this scope for(i=1; i<=m; i++) ^ componenteconexe.cpp:39:14: error: 'x' was not declared in this scope fin>>x>>y; ^ componenteconexe.cpp:39:17: error: 'y' was not declared in this scope fin>>x>>y; ^ componenteconexe.cpp:40:9: error: 'a' was not declared in this scope a[x][y]=1; ^ componenteconexe.cpp:44:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ componenteconexe.cpp:43:9: warning: unused variable 'nrc' [-Wunused-variable] int nrc=0; ^
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ă.