#438
Se dă lista muchiilor unui graf neorientat. Să se afișeze componentele conexe ale acestui graf.
| Problema | ComponenteConexe | Operații I/O |
componenteconexe.in/componenteconexe.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64107644 | Utilizator | |
| Fișier | componenteconexe.cpp | Dimensiune | 807 B |
| Data încărcării | 17 Aprilie 2026, 11:44 | Scor/rezultat | Eroare de compilare |
componenteconexe.cpp: In function ‘int verificare()’: componenteconexe.cpp:7:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 7 | {for(i=1;i<=n;i++) | ^~~ componenteconexe.cpp:10:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 10 | return -1;} | ^~~~~~ componenteconexe.cpp: In function ‘int main()’: componenteconexe.cpp:20:18: error: too many arguments to function ‘int verificare()’ 20 | while(verificare(viz)!=-1) | ~~~~~~~~~~^~~~~ componenteconexe.cpp:6:5: note: declared here 6 | int verificare() | ^~~~~~~~~~ componenteconexe.cpp:24:22: error: too many arguments to function ‘int verificare()’ 24 | c[pi]=verificare(viz); | ~~~~~~~~~~^~~~~ componenteconexe.cpp:6:5: note: declared here 6 | int verificare() | ^~~~~~~~~~ componenteconexe.cpp:25:17: error: too many arguments to function ‘int verificare()’ 25 | viz[verificare(viz)]=1; | ~~~~~~~~~~^~~~~ componenteconexe.cpp:6:5: note: declared here 6 | int verificare() | ^~~~~~~~~~ componenteconexe.cpp:35:14: error: ‘p1’ was not declared in this scope; did you mean ‘ps’? 35 | for(j=1;j<=p1;j++) | ^~ | ps componenteconexe.cpp:36:10: error: ‘nc’ was not declared in this scope; did you mean ‘nrc’? 36 | cc[nc][j]=c[j];} | ^~ | nrc componenteconexe.cpp:38:13: error: ‘nc’ was not declared in this scope; did you mean ‘nrc’? 38 | for(i=1;i<=nc;i++) | ^~ | nrc componenteconexe.cpp:39:15: error: expected ‘;’ before ‘fin’ 39 | fout<<"NU" | ^ | ; ...... 43 | fin.close(); | ~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe 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ă.