#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 | #64652336 | Utilizator | |
| Fișier | componenteconexe.cpp | Dimensiune | 1023 B |
| Data încărcării | 20 Mai 2026, 16:32 | Scor/rezultat | Eroare de compilare |
componenteconexe.cpp:6:34: error: expected initializer before ‘n’ 6 | int a[101][101],lee[101],viz[101]n,m,pr,ul,x,t,nrc; | ^ componenteconexe.cpp: In function ‘void citire()’: componenteconexe.cpp:9:12: error: ‘n’ was not declared in this scope 9 | fin >> n; | ^ componenteconexe.cpp: In function ‘void bfs(int, int)’: componenteconexe.cpp:18:4: error: ‘pr’ was not declared in this scope 18 | { pr=1;ul=1; | ^~ componenteconexe.cpp:18:9: error: ‘ul’ was not declared in this scope 18 | { pr=1;ul=1; | ^~ componenteconexe.cpp:20:1: error: ‘viz’ was not declared in this scope 20 | viz[t]=nrc; | ^~~ componenteconexe.cpp:25:20: error: ‘n’ was not declared in this scope 25 | for(int i=1;i<=n;i++) | ^ componenteconexe.cpp: In function ‘int main()’: componenteconexe.cpp:40:20: error: ‘n’ was not declared in this scope 40 | for(int i=1;i<=n;i++) | ^ componenteconexe.cpp:42:12: error: ‘viz’ was not declared in this scope 42 | if(viz[i]==0) | ^~~ componenteconexe.cpp:44:13: error: ‘nrc’ was not declared in this scope 44 | nrc++; | ^~~ componenteconexe.cpp:48:12: error: ‘nrc’ was not declared in this scope 48 | fout << nrc << endl; | ^~~ componenteconexe.cpp:51:23: error: ‘n’ was not declared in this scope 51 | for(int j=1;j<=n;j++) | ^ componenteconexe.cpp:53:15: error: ‘viz’ was not declared in this scope 53 | if(viz[j]==i) | ^~~
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ă.