#3423
Se dă un graf orientat cu n vârfuri și m arce prin lista arcelor. Afișați componentele tare conexe formate din număr maxim de vârfuri.
| Problema | ctcmax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64935176 | Utilizator | |
| Fișier | ctcmax.cpp | Dimensiune | 2.74 KB |
| Data încărcării | 16 Iunie 2026, 19:25 | Scor/rezultat | Eroare de compilare |
ctcmax.cpp: In function ‘void df_direct(int)’: ctcmax.cpp:13:12: error: invalid types ‘int[int]’ for array subscript 13 | vizitat[nod] = 1; | ^ ctcmax.cpp:16:14: error: invalid types ‘int[int]’ for array subscript 16 | if (a[nod][i] == 1 && !vizitat[i]) | ^ ctcmax.cpp:16:39: error: invalid types ‘int[int]’ for array subscript 16 | if (a[nod][i] == 1 && !vizitat[i]) | ^ ctcmax.cpp:21:10: error: invalid types ‘int[int]’ for array subscript 21 | stiva[++varf_stiva] = nod; | ^ ctcmax.cpp: In function ‘void df_transpus(int)’: ctcmax.cpp:26:14: error: invalid types ‘int[int]’ for array subscript 26 | vizitat_t[nod] = 1; | ^ ctcmax.cpp:27:15: error: invalid types ‘int[int]’ for array subscript 27 | componenta[++nr_noduri] = nod; | ^ ctcmax.cpp:30:15: error: invalid types ‘int[int]’ for array subscript 30 | if (at[nod][i] == 1 && !vizitat_t[i]) | ^ ctcmax.cpp:30:42: error: invalid types ‘int[int]’ for array subscript 30 | if (at[nod][i] == 1 && !vizitat_t[i]) | ^ ctcmax.cpp: In function ‘int main()’: ctcmax.cpp:44:10: error: invalid types ‘int[int]’ for array subscript 44 | a[x][y] = 1; | ^ ctcmax.cpp:45:11: error: invalid types ‘int[int]’ for array subscript 45 | at[y][x] = 1; | ^ ctcmax.cpp:50:21: error: invalid types ‘int[int]’ for array subscript 50 | if (!vizitat[i]) | ^ ctcmax.cpp:58:24: error: invalid types ‘int[int]’ for array subscript 58 | int nod = stiva[varf_stiva]; | ^ ctcmax.cpp:61:23: error: invalid types ‘int[int]’ for array subscript 61 | if (!vizitat_t[nod]) | ^ ctcmax.cpp:70:35: error: invalid types ‘int[int]’ for array subscript 70 | if (componenta[j] > componenta[l]) | ^ ctcmax.cpp:70:51: error: invalid types ‘int[int]’ for array subscript 70 | if (componenta[j] > componenta[l]) | ^ ctcmax.cpp:72:45: error: invalid types ‘int[int]’ for array subscript 72 | int aux = componenta[j]; | ^ ctcmax.cpp:73:35: error: invalid types ‘int[int]’ for array subscript 73 | componenta[j] = componenta[l]; | ^ ctcmax.cpp:73:51: error: invalid types ‘int[int]’ for array subscript 73 | componenta[j] = componenta[l]; | ^ ctcmax.cpp:74:35: error: invalid types ‘int[int]’ for array subscript 74 | componenta[l] = aux; | ^ ctcmax.cpp:80:23: error: invalid types ‘int[int]’ for array subscript 80 | marime_ctc[nr_componente] = nr_noduri; | ^ ctcmax.cpp:83:20: error: invalid types ‘int[int]’ for array subscript 83 | ctc[nr_componente][j] = componenta[j]; | ^ ctcmax.cpp:83:51: error: invalid types ‘int[int]’ for array subscript 83 | ctc[nr_componente][j] = componenta[j]; | ^ ctcmax.cpp:97:20: error: invalid types ‘int[int]’ for array subscript 97 | if (ctc[i][1] > ctc[j][1]) | ^ ctcmax.cpp:97:32: error: invalid types ‘int[int]’ for array subscript 97 | if (ctc[i][1] > ctc[j][1]) | ^ ctcmax.cpp:99:44: error: invalid types ‘int[int]’ for array subscript 99 | int aux_marime = marime_ctc[i]; | ^ ctcmax.cpp:100:27: error: invalid types ‘int[int]’ for array subscript 100 | marime_ctc[i] = marime_ctc[j]; | ^ ctcmax.cpp:100:43: error: invalid types ‘int[int]’ for array subscript 100 | marime_ctc[i] = marime_ctc[j]; | ^ ctcmax.cpp:101:27: error: invalid types ‘int[int]’ for array subscript 101 | marime_ctc[j] = aux_marime; | ^ ctcmax.cpp:105:38: error: invalid types ‘int[int]’ for array subscript 105 | int aux_nod = ctc[i][l]; | ^ ctcmax.cpp:106:24: error: invalid types ‘int[int]’ for array subscript 106 | ctc[i][l] = ctc[j][l]; | ^ ctcmax.cpp:106:36: error: invalid types ‘int[int]’ for array subscript 106 | ctc[i][l] = ctc[j][l]; | ^ ctcmax.cpp:107:24: error: invalid types ‘int[int]’ for array subscript 107 | ctc[j][l] = aux_nod; | ^ ctcmax.cpp:115:23: error: invalid types ‘int[int]’ for array subscript 115 | if (marime_ctc[i] == maxim) | ^ ctcmax.cpp:117:44: error: invalid types ‘int[int]’ for array subscript 117 | for (int j = 1; j <= marime_ctc[i]; j++) | ^ ctcmax.cpp:119:28: error: invalid types ‘int[int]’ for array subscript 119 | cout << ctc[i][j] << " "; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ctcmax 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ă.