#475
Se dă lista muchiilor unui graf neorientat cu n vârfuri și două vârfuri p q. Să se determine toate lanțurile elementare cu extremitățile p și q.
| Problema | Lant | Operații I/O |
lant.in/lant.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64373346 | Utilizator | |
| Fișier | lant.cpp | Dimensiune | 1.00 KB |
| Data încărcării | 04 Mai 2026, 10:14 | Scor/rezultat | Eroare de compilare |
lant.cpp: In function ‘int valid(int)’: lant.cpp:12:17: error: ‘p’ was not declared in this scope 12 | if(x[1]=p) | ^ lant.cpp:19:5: error: ‘else’ without a previous ‘if’ 19 | else return 1; | ^~~~ lant.cpp: In function ‘int solutie(int)’: lant.cpp:23:12: error: lvalue required as left operand of assignment 23 | if(k>=2&&x[k]=q) | ~~~~^~~~~~ lant.cpp: In function ‘void tipar(int)’: lant.cpp:29:5: error: ‘nr’ was not declared in this scope; did you mean ‘n’? 29 | nr++; | ^~ | n lant.cpp: In function ‘void back(int)’: lant.cpp:41:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 41 | if(valid(k)==1) | ^ lant.cpp: In function ‘int main()’: lant.cpp:49:13: error: ‘m’ was not declared in this scope 49 | fin>>n>>m; | ^ lant.cpp:55:10: error: ‘p’ was not declared in this scope 55 | fin>>p>>q; | ^ lant.cpp:58:8: error: ‘nr’ was not declared in this scope; did you mean ‘n’? 58 | if(nr==0) | ^~ | n lant.cpp: In function ‘int solutie(int)’: lant.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type] 26 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Lant 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ă.