#4290
Se dă un graf neorientat cu n vârfuri numerotate de la 1 la n și m muchii. Știind că graful are cel puțin un ciclu, să se determine un ciclu elementar în acest graf.
| Problema | GasesteCiclu | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64234242 | Utilizator | |
| Fișier | gasesteciclu.cpp | Dimensiune | 714 B |
| Data încărcării | 24 Aprilie 2026, 12:31 | Scor/rezultat | Eroare de compilare |
gasesteciclu.cpp: In function ‘int dfs(int)’: gasesteciclu.cpp:13:17: error: ‘j’ was not declared in this scope 13 | if(a[i][j]) | ^ gasesteciclu.cpp:16:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 16 | if(k>=3 && i==nod); | ^~ gasesteciclu.cpp:17:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 17 | { | ^ gasesteciclu.cpp:20:13: error: expected ‘}’ before ‘else’ 20 | else if(!visit[i]) | ^~~~ gasesteciclu.cpp:14:9: note: to match this ‘{’ 14 | { | ^ gasesteciclu.cpp: At global scope: gasesteciclu.cpp:24:5: error: expected unqualified-id before ‘return’ 24 | return 0; | ^~~~~~ gasesteciclu.cpp:26:1: error: expected declaration before ‘}’ token 26 | } | ^ gasesteciclu.cpp: In function ‘int dfs(int)’: gasesteciclu.cpp:23:5: warning: control reaches end of non-void function [-Wreturn-type] 23 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GasesteCiclu 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ă.