#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 | #64373162 | Utilizator | |
| Fișier | lantq.cpp | Dimensiune | 923 B |
| Data încărcării | 04 Mai 2026, 10:10 | Scor/rezultat | 20 puncte |
lantq.cpp: In function ‘int valid(int)’: lantq.cpp:11:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 11 | for(i=1;i<=k-1;i++) | ^~~ lantq.cpp:14:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 14 | if(k>1&&a[x[k]][x[k-1]]==0) | ^~ lantq.cpp: In function ‘void back(int)’: lantq.cpp:36:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 36 | if(valid(k)==1) | ^ lantq.cpp: In function ‘int valid(int)’: lantq.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type] 16 | } | ^ lantq.cpp: In function ‘void tipar(int)’: lantq.cpp:25:7: warning: ‘nr’ is used uninitialized [-Wuninitialized] 25 | nr++; | ~~^~ lantq.cpp:24:11: note: ‘nr’ was declared here 24 | int i,nr; | ^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 4 | 0.001 secunde | OK. | 20 | 20 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 20 | |||||
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ă.