#441
Se dă lista muchiilor unui graf neorientat. Să se determine numărul minim de muchii care trebuie adăugate pentru ca graful să devină conex, precum și un set de asemenea muchii.
Problema | ComponenteConexe1 | Operații I/O |
![]() componenteconexe1.in /componenteconexe1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56018492 | Utilizator | |
Fișier | componenteconexe1.cpp | Dimensiune | 1.30 KB |
Data încărcării | 03 Februarie 2025, 12:45 | Scor / rezultat | Eroare de compilare |
componenteconexe1.cpp:6:1: error: expected ',' or ';' before 'int' int n, mat[101][101], viz[101]={0}, nrc; ^ componenteconexe1.cpp:6:35: error: expected unqualified-id before ',' token int n, mat[101][101], viz[101]={0}, nrc; ^ componenteconexe1.cpp:6:40: error: expected constructor, destructor, or type conversion before ';' token int n, mat[101][101], viz[101]={0}, nrc; ^ componenteconexe1.cpp: In function 'void citire()': componenteconexe1.cpp:10:10: error: 'n' was not declared in this scope fin>>n; ^ componenteconexe1.cpp:13:9: error: 'mat' was not declared in this scope mat[x][y]=mat[y][x]=1; ^ componenteconexe1.cpp: In function 'void parcurgere(int)': componenteconexe1.cpp:20:5: error: 'viz' was not declared in this scope viz[y]=nrc; ^ componenteconexe1.cpp:20:12: error: 'nrc' was not declared in this scope viz[y]=nrc; ^ componenteconexe1.cpp:27:20: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe1.cpp:29:16: error: 'mat' was not declared in this scope if(mat[x][i]!=0 && viz[i]==0) ^ componenteconexe1.cpp: In function 'void descCompConexe()': componenteconexe1.cpp:43:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ componenteconexe1.cpp:45:12: error: 'viz' was not declared in this scope if(viz[i]==0) ^ componenteconexe1.cpp:47:13: error: 'nrc' was not declared in this scope nrc++; ^ componenteconexe1.cpp: In function 'void adaugareMuchii()': componenteconexe1.cpp:56:11: error: 'nrc' was not declared in this scope fout<<nrc-1; ^ componenteconexe1.cpp:61:16: error: 'viz' was not declared in this scope while (viz[i]!=nrc) ^ componenteconexe1.cpp:55:14: warning: unused variable 'c' [-Wunused-variable] int i=2, c=2; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe1 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ă.