#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 | #64996738 | Utilizator | |
| Fișier | lantpq.cpp | Dimensiune | 1.11 KB |
| Data încărcării | 08 Iulie 2026, 17:38 | Scor/rezultat | 100 puncte |
lantpq.cpp: In function ‘void afisare()’: lantpq.cpp:12:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 12 | for(int i=0;i<afis.size();i++) | ~^~~~~~~~~~~~ lantpq.cpp: In function ‘void dfs(int)’: lantpq.cpp:21:19: warning: comparison of integer expressions of different signedness: ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 21 | if(afis.size()>=p&&afis.size()<=q) | ~~~~~~~~~~~^~~ lantpq.cpp:21:35: warning: comparison of integer expressions of different signedness: ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 21 | if(afis.size()>=p&&afis.size()<=q) | ~~~~~~~~~~~^~~ lantpq.cpp:23:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 23 | for(int i=0;i<a[x].size();i++) | ~^~~~~~~~~~~~ lantpq.cpp: In function ‘int main()’: lantpq.cpp:39:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 39 | for(int j=0;j<a[x].size();j++) | ~^~~~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | ||
| 2 | 0.095 secunde | OK. | 20 | 20 | ||
| 3 | 0.035 secunde | OK. | 20 | 20 | ||
| 4 | 0.001 secunde | OK. | 20 | 20 | ||
| 5 | 0.001 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ă.