#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 | #64934890 | Utilizator | |
| Fișier | componenteconexe.cpp | Dimensiune | 2.00 KB |
| Data încărcării | 16 Iunie 2026, 18:30 | Scor/rezultat | Eroare de compilare |
componenteconexe.cpp: In function ‘void df(int)’: componenteconexe.cpp:14:12: error: invalid types ‘int[int]’ for array subscript 14 | vizitat[nod] = 1; | ^ componenteconexe.cpp:15:15: error: invalid types ‘int[int]’ for array subscript 15 | componenta[++nr_noduri] = nod; | ^ componenteconexe.cpp:18:14: error: invalid types ‘int[int]’ for array subscript 18 | if (a[nod][i] == 1 && !vizitat[i]) | ^ componenteconexe.cpp:18:39: error: invalid types ‘int[int]’ for array subscript 18 | if (a[nod][i] == 1 && !vizitat[i]) | ^ componenteconexe.cpp: In function ‘int main()’: componenteconexe.cpp:31:10: error: invalid types ‘int[int]’ for array subscript 31 | a[x][y] = 1; | ^ componenteconexe.cpp:32:10: error: invalid types ‘int[int]’ for array subscript 32 | a[y][x] = 1; | ^ componenteconexe.cpp:37:21: error: invalid types ‘int[int]’ for array subscript 37 | if (!vizitat[i]) | ^ componenteconexe.cpp:47:35: error: invalid types ‘int[int]’ for array subscript 47 | if (componenta[j] > componenta[l]) | ^ componenteconexe.cpp:47:51: error: invalid types ‘int[int]’ for array subscript 47 | if (componenta[j] > componenta[l]) | ^ componenteconexe.cpp:49:45: error: invalid types ‘int[int]’ for array subscript 49 | int aux = componenta[j]; | ^ componenteconexe.cpp:50:35: error: invalid types ‘int[int]’ for array subscript 50 | componenta[j] = componenta[l]; | ^ componenteconexe.cpp:50:51: error: invalid types ‘int[int]’ for array subscript 50 | componenta[j] = componenta[l]; | ^ componenteconexe.cpp:51:35: error: invalid types ‘int[int]’ for array subscript 51 | componenta[l] = aux; | ^ componenteconexe.cpp:62:16: error: invalid types ‘int[int]’ for array subscript 62 | vizitat[i] = 0; | ^ componenteconexe.cpp:67:21: error: invalid types ‘int[int]’ for array subscript 67 | if (!vizitat[i]) | ^ componenteconexe.cpp:76:35: error: invalid types ‘int[int]’ for array subscript 76 | if (componenta[j] > componenta[l]) | ^ componenteconexe.cpp:76:51: error: invalid types ‘int[int]’ for array subscript 76 | if (componenta[j] > componenta[l]) | ^ componenteconexe.cpp:78:45: error: invalid types ‘int[int]’ for array subscript 78 | int aux = componenta[j]; | ^ componenteconexe.cpp:79:35: error: invalid types ‘int[int]’ for array subscript 79 | componenta[j] = componenta[l]; | ^ componenteconexe.cpp:79:51: error: invalid types ‘int[int]’ for array subscript 79 | componenta[j] = componenta[l]; | ^ componenteconexe.cpp:80:35: error: invalid types ‘int[int]’ for array subscript 80 | componenta[l] = aux; | ^ componenteconexe.cpp:87:35: error: invalid types ‘int[int]’ for array subscript 87 | fout << componenta[j] << " "; | ^
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ă.