#438
ComponenteConexe
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 | #50398020 | Utilizator | |
Fișier | componenteconexe.cpp | Dimensiune | 933 B |
Data încărcării | 08 Aprilie 2024, 11:09 | Scor / rezultat | Eroare de compilare |
componenteconexe.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream g("componentecnexe.out") ^ componenteconexe.cpp: In function 'void bfs(int)': componenteconexe.cpp:14:5: error: 'viz' was not declared in this scope viz[nod]=nrc; ^ componenteconexe.cpp:14:14: error: 'nrc' was not declared in this scope viz[nod]=nrc; ^ componenteconexe.cpp:19:20: error: 'n' was not declared in this scope for(j=1;j<=n;j++) ^ componenteconexe.cpp:20:12: error: 'a' was not declared in this scope if(a[i][j]==1&&viz[j]==0) ^ componenteconexe.cpp: In function 'int main()': componenteconexe.cpp:33:8: error: 'n' was not declared in this scope f>>n; ^ componenteconexe.cpp:34:14: error: 'x' was not declared in this scope while(f>>x){ ^ componenteconexe.cpp:35:16: error: 'y' was not declared in this scope f>>y; ^ componenteconexe.cpp:36:9: error: 'a' was not declared in this scope a[x][y]=1; ^ componenteconexe.cpp:40:12: error: 'viz' was not declared in this scope if(viz[i]==0) ^ componenteconexe.cpp:42:9: error: 'nrc' was not declared in this scope nrc++; ^ componenteconexe.cpp:45:5: error: 'g' was not declared in this scope g<<nrc<<endl; ^ componenteconexe.cpp:45:8: error: 'nrc' was not declared in this scope g<<nrc<<endl; ^ componenteconexe.cpp:49:16: error: 'viz' was not declared in this scope 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ă.