#4956
Se dă un graf neorientat cu n vârfuri și două numere naturale p și q. Să se determine toate lanțurile elementare formate din cel puțin p muchii și cel mult q muchii, adică au lungimea în intervalul [p,q].
| Problema | LantPQ | Operații I/O |
lantpq.in/lantpq.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64903582 | Utilizator | |
| Fișier | lantpq.cpp | Dimensiune | 1.11 KB |
| Data încărcării | 11 Iunie 2026, 08:53 | Scor/rezultat | 100 puncte |
lantpq.cpp: In function ‘void dfs(int)’: lantpq.cpp:18:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 18 | if(p <= lant.size() - 1 && lant.size() - 1 <= q) { | ~~^~~~~~~~~~~~~~~~~~ lantpq.cpp:18:48: warning: comparison of integer expressions of different signedness: ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 18 | if(p <= lant.size() - 1 && lant.size() - 1 <= q) { | ~~~~~~~~~~~~~~~~^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.003 secunde | OK. | 20 | 20 | ||
| 2 | 0.151 secunde | OK. | 20 | 20 | ||
| 3 | 0.117 secunde | OK. | 20 | 20 | ||
| 4 | 0.005 secunde | OK. | 20 | 20 | ||
| 5 | 0.003 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LantPQ 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ă.