#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 | #64310193 | Utilizator | |
| Fișier | tare_conexitate.cpp | Dimensiune | 820 B |
| Data încărcării | 29 Aprilie 2026, 08:48 | Scor/rezultat | Eroare de compilare |
tare_conexitate.cpp: In function ‘void curatare()’: tare_conexitate.cpp:22:25: warning: the address of ‘v2’ will never be NULL [-Waddress] 22 | if((v1[i]==0&&v2!=0)||(v1[1]!=0&&v2[i]==0)) | ~~^~~ tare_conexitate.cpp:3:33: note: ‘v2’ declared here 3 | int n,m,x,y,a[105][105],v1[105],v2[105]; | ^~ tare_conexitate.cpp:23:1: error: expected primary-expression before ‘}’ token 23 | } | ^ tare_conexitate.cpp: In function ‘int poz()’: tare_conexitate.cpp:27:12: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 27 | if((v1[i]==0) | ^ tare_conexitate.cpp:27:22: error: expected ‘;’ before ‘return’ 27 | if((v1[i]==0) | ^ | ; 28 | return i; | ~~~~~~ tare_conexitate.cpp:27:18: warning: statement has no effect [-Wunused-value] 27 | if((v1[i]==0) | ~~~~~~^~~~ tare_conexitate.cpp:29:9: error: expected primary-expression before ‘return’ 29 | return 0; | ^~~~~~ tare_conexitate.cpp:28:21: error: expected ‘)’ before ‘return’ 28 | return i; | ^ | ) 29 | return 0; | ~~~~~~ tare_conexitate.cpp:27:11: note: to match this ‘(’ 27 | if((v1[i]==0) | ^ tare_conexitate.cpp:30:1: warning: no return statement in function returning non-void [-Wreturn-type] 30 | } | ^ tare_conexitate.cpp: In function ‘int main()’: tare_conexitate.cpp:37:15: warning: statement has no effect [-Wunused-value] 37 | a[x][y]; | ~~~~~~^
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ă.