#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 | #64310158 | Utilizator | |
| Fișier | tare_conexitate.cpp | Dimensiune | 936 B |
| Data încărcării | 29 Aprilie 2026, 08:48 | Scor/rezultat | Eroare de compilare |
tare_conexitate.cpp: In function ‘void dfs2(int, int)’: tare_conexitate.cpp:14:13: error: ‘nr’ was not declared in this scope; did you mean ‘n’? 14 | v2[nod]=nr; | ^~ | n tare_conexitate.cpp: In function ‘void curatare()’: tare_conexitate.cpp:23:34: error: expected primary-expression before ‘||’ token 23 | if(v1[i]==0 && v2[i]!=0) || if(v1[i]!=0 && v2[i]==0) v1[i]=v2[i]=0; | ^~ tare_conexitate.cpp:23:37: error: expected primary-expression before ‘if’ 23 | if(v1[i]==0 && v2[i]!=0) || if(v1[i]!=0 && v2[i]==0) v1[i]=v2[i]=0; | ^~ tare_conexitate.cpp: In function ‘int pos()’: tare_conexitate.cpp:30:30: error: expected ‘;’ before ‘}’ token 30 | if(v1[i]==0) return i | ^ | ; 31 | } | ~
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ă.