#4961
Într-un graf neorientat, numim antilanț un șir de noduri S[1] S[2] ... S[k] cu proprietatea că oricare două noduri consecutive S[i] S[i+1], 1≤i<n, nu sunt adiacente. Un antilanț se numește elementar dacă nodurile din el nu se repetă.
Se dă un graf neorientat cu n vârfuri, un vârf x și un număr L. Să se determine toate antilanțurile elementare formate care încep cu nodul x și conțin cel puțin L noduri.
| Problema | AntilantXL | Operații I/O |
antilantxl.in/antilantxl.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64995848 | Utilizator | |
| Fișier | antilantxl.cpp | Dimensiune | 1.22 KB |
| Data încărcării | 08 Iulie 2026, 14:11 | Scor/rezultat | 80 puncte |
antilantxl.cpp: In function ‘void afis()’: antilantxl.cpp:11:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 11 | for(int i=0;i<q.size();i++) | ~^~~~~~~~~ antilantxl.cpp: In function ‘void dfs(int)’: antilantxl.cpp:19:16: warning: comparison of integer expressions of different signedness: ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 19 | if(q.size()>=l) | ~~~~~~~~^~~ antilantxl.cpp:21:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 21 | for(int i=0;i<b[x].size();i++) | ~^~~~~~~~~~~~ antilantxl.cpp: In function ‘int main()’: antilantxl.cpp:45:30: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 45 | for(int k=0;k<a[i].size();k++) | ~^~~~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 20 | 20 | ||
| 3 | 0.042 secunde | OK. | 20 | 20 | ||
| 4 | 0.002 secunde | OK. | 20 | 20 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 80 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AntilantXL 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ă.