#583
Se dă un graf orientat cu n noduri. Să se determine câte componente tare conexe are graful dat.
| Problema | Tare conexitate | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #62964562 | Utilizator | |
| Fișier | tare_conexitate.cpp | Dimensiune | 604 B |
| Data încărcării | 09 Februarie 2026, 08:32 | Scor/rezultat | Eroare de compilare |
tare_conexitate.cpp: In function 'int main()': tare_conexitate.cpp:7:17: error: expected identifier before numeric constant int n,m,a=[101][101]={0},v[101]={0},nr=0,x,y; ^ tare_conexitate.cpp: In lambda function: tare_conexitate.cpp:7:21: error: expected '{' before '[' token int n,m,a=[101][101]={0},v[101]={0},nr=0,x,y; ^ tare_conexitate.cpp: In function 'int main()': tare_conexitate.cpp:7:21: error: no match for 'operator[]' (operand types are 'main()::__lambda0' and 'int') tare_conexitate.cpp:9:16: error: unable to find numeric literal operator 'operator"" li' for(int i=1li<=n;i++) ^ tare_conexitate.cpp:9:26: error: expected ';' before ')' token for(int i=1li<=n;i++) ^ tare_conexitate.cpp:12:13: error: invalid types 'int[int]' for array subscript a[x][y]=1; ^ tare_conexitate.cpp:17:23: error: invalid types 'int[int]' for array subscript if(i!=j && a[i][j]==0) ^ tare_conexitate.cpp:18:12: error: invalid types 'int[int]' for array subscript a[i][j]=a[i][k]*a[k][j]; ^ tare_conexitate.cpp:18:20: error: invalid types 'int[int]' for array subscript a[i][j]=a[i][k]*a[k][j]; ^ tare_conexitate.cpp:18:28: error: invalid types 'int[int]' for array subscript a[i][j]=a[i][k]*a[k][j]; ^ tare_conexitate.cpp:20:12: error: 'v' was not declared in this scope if(v[i]==0) ^ tare_conexitate.cpp:25:19: error: invalid types 'int[int]' for array subscript if(a[i][j]==1 && a[j][i]==1) ^ tare_conexitate.cpp:25:33: error: invalid types 'int[int]' for array subscript if(a[i][j]==1 && a[j][i]==1) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Tare conexitate 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ă.