#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 | #64373112 | Utilizator | |
| Fișier | lantq.cpp | Dimensiune | 1.03 KB |
| Data încărcării | 04 Mai 2026, 10:08 | Scor/rezultat | Eroare de compilare |
lantq.cpp: In function ‘int valid(int)’: lantq.cpp:13:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 13 | for(i=1;i<=k;i++) | ^~~ lantq.cpp:16:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 16 | if(k>1&&a[x[k]][x[k-1]]==0) | ^~ lantq.cpp: In function ‘void tipar(int)’: lantq.cpp:38:9: error: ‘cout’ was not declared in this scope 38 | cout<<x[i]<<" "; | ^~~~ lantq.cpp:2:1: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? 1 | #include <fstream> +++ |+#include <iostream> 2 | using namespace std; lantq.cpp:40:5: error: ‘cout’ was not declared in this scope 40 | cout<<endl; | ^~~~ lantq.cpp:40:5: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? lantq.cpp: In function ‘void back(int)’: lantq.cpp:50:12: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 50 | if (valid(k)==1) | ^ lantq.cpp: In function ‘int main()’: lantq.cpp:69:9: error: ‘cout’ was not declared in this scope 69 | cout<<"Nu exista"; | ^~~~ lantq.cpp:69:9: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
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ă.