#2282
Se consideră un graf neorientat cu n
vârfuri și m
muchii. Cele m
muchii se elimină pe rând din graf. Pentru fiecare muchie eliminată trebuie să spuneți câte componente conexe are graful.
Problema | ComponenteConexe4 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57412022 | Utilizator | |
Fișier | componenteconexe4.cpp | Dimensiune | 1.87 KB |
Data încărcării | 30 Martie 2025, 11:32 | Scor / rezultat | Eroare de compilare |
componenteconexe4.cpp:9:25: error: size of array 'a' is too large int a[100001][100001]; ^ componenteconexe4.cpp: In function 'void adaugareMuchie(muchie)': componenteconexe4.cpp:20:7: error: 'struct Graf' has no member named 'a' g.a[i][j] = g.a[j][i] = 1; ^ componenteconexe4.cpp:20:19: error: 'struct Graf' has no member named 'a' g.a[i][j] = g.a[j][i] = 1; ^ componenteconexe4.cpp: In function 'void elimMuchie(muchie)': componenteconexe4.cpp:27:7: error: 'struct Graf' has no member named 'a' g.a[i][j] = g.a[j][i] = 0; ^ componenteconexe4.cpp:27:19: error: 'struct Graf' has no member named 'a' g.a[i][j] = g.a[j][i] = 0; ^ componenteconexe4.cpp: In function 'void BFS(int, int, int)': componenteconexe4.cpp:41:19: error: 'struct Graf' has no member named 'a' if (g.a[elem][j] == 1 && viz[j] == neviz) ^ componenteconexe4.cpp: In function 'int main()': componenteconexe4.cpp:54:23: warning: unused variable 's' [-Wunused-variable] int a, b, nr = 1, s = 0, cntmax = 0, imax = 0; ^ componenteconexe4.cpp:54:30: warning: unused variable 'cntmax' [-Wunused-variable] int a, b, nr = 1, s = 0, cntmax = 0, imax = 0; ^ componenteconexe4.cpp:54:42: warning: unused variable 'imax' [-Wunused-variable] int a, b, nr = 1, s = 0, cntmax = 0, imax = 0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe4 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ă.