#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 | #64373354 | Utilizator | |
| Fișier | lantq.cpp | Dimensiune | 889 B |
| Data încărcării | 04 Mai 2026, 10:14 | Scor/rezultat | 0 puncte |
lantq.cpp: In function ‘int valid(int)’: lantq.cpp:11:23: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 11 | if(x[k]==x[i]||k>1&&a[x[k]][x[k-1]]==0) return 0; | ~~~^~~~~~~~~~~~~~~~~~~~ lantq.cpp:10:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(i=1;i<=k-1;i++) | ^~~ lantq.cpp:12:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 12 | if(k>1&&a[x[k]][x[k-1]]==0) return 0; | ^~ lantq.cpp: In function ‘void back(int)’: lantq.cpp:35:15: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 35 | if(valid(k)==1) | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.327 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.369 secunde | Raspuns gresit. | 20 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 0 | |||||
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ă.