#4276
Dându-se un graf neorientat cu n noduri și m muchii, să se determine numărul componentelor conexe.
| Problema | NrCompConexe | Operații I/O |
nrcompconexe.in/nrcompconexe.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64575480 | Utilizator | |
| Fișier | nrcompconexe.cpp | Dimensiune | 842 B |
| Data încărcării | 15 Mai 2026, 11:29 | Scor/rezultat | 100 puncte |
nrcompconexe.cpp: In function ‘int main()’: nrcompconexe.cpp:39:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 39 | for(i=1;i<=g.n;i++) | ^~~ nrcompconexe.cpp:45:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 45 | fout<<nrc; | ^~~~ nrcompconexe.cpp:24:17: warning: unused variable ‘max’ [-Wunused-variable] 24 | int i,j,nrc,max,nrn,r,k; | ^~~ nrcompconexe.cpp:24:21: warning: unused variable ‘nrn’ [-Wunused-variable] 24 | int i,j,nrc,max,nrn,r,k; | ^~~ nrcompconexe.cpp:24:25: warning: unused variable ‘r’ [-Wunused-variable] 24 | int i,j,nrc,max,nrn,r,k; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.003 secunde | OK. | 10 | 10 | Exemplu | |
| 1 | 0.002 secunde | OK. | 10 | 10 | ||
| 2 | 0.002 secunde | OK. | 10 | 10 | ||
| 3 | 0.001 secunde | OK. | 10 | 10 | ||
| 4 | 0.001 secunde | OK. | 10 | 10 | ||
| 5 | 0.001 secunde | OK. | 10 | 10 | ||
| 6 | 0.001 secunde | OK. | 10 | 10 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| 8 | 0.001 secunde | OK. | 10 | 10 | ||
| 9 | 0.002 secunde | OK. | 10 | 10 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrCompConexe 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ă.