#4061
Se dă un graf neorientat cu n vârfuri și un număr natural q. Să se determine toate lanțurile elementare formate din cel puțin o muchie, cu extremitatea finală în vârful q.
| Problema | LantQ | Operații I/O |
lantq.in/lantq.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64372943 | Utilizator | |
| Fișier | lantq.cpp | Dimensiune | 808 B |
| Data încărcării | 04 Mai 2026, 10:01 | Scor/rezultat | Eroare de compilare |
lantq.cpp: In function ‘int valid(int)’: lantq.cpp:10:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(i=1;i<=k-1;i++) | ^~~ lantq.cpp:13:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | if(k>1&&a[x[k]][x[k-1]]!=1) | ^~ lantq.cpp: In function ‘int solutie(int)’: lantq.cpp:19:12: error: lvalue required as left operand of assignment 19 | if(k>=2&&x[k]=q) | ~~~~^~~~~~ lantq.cpp: In function ‘void back(int)’: lantq.cpp:37:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 37 | if(valid(k)==1) | ^ lantq.cpp: In function ‘int solutie(int)’: lantq.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type] 22 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LantQ 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ă.