#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 | #62168624 | Utilizator | |
| Fișier | lant.cpp | Dimensiune | 704 B |
| Data încărcării | 12 Ianuarie 2026, 13:50 | Scor/rezultat | Eroare de compilare |
lant.cpp: In function 'void afis(int)': lant.cpp:10:16: error: 'st' was not declared in this scope out << st[i]; ^ lant.cpp: In function 'int valid(int)': lant.cpp:13:19: error: 'a' was not declared in this scope {int i; if(k>1 && a[st[k]][st[k-1]] == 0) return 0; ^ lant.cpp:13:21: error: 'st' was not declared in this scope {int i; if(k>1 && a[st[k]][st[k-1]] == 0) return 0; ^ lant.cpp:15:9: error: 'st' was not declared in this scope if(st[i]==st[k]) return 0; ^ lant.cpp: In function 'void bck(int)': lant.cpp:20:3: error: 'st' was not declared in this scope {st[k]=i; ^ lant.cpp:22:17: error: 'q' was not declared in this scope if(st[k]==q) afis(k); ^ lant.cpp: In function 'int main()': lant.cpp:29:16: error: 'm' was not declared in this scope in >> n >> m; ^ lant.cpp:36:12: error: 'q' was not declared in this scope in >> p >> q; ^ lant.cpp:37:1: error: 'st' was not declared in this scope st[1] = p; ^ lant.cpp: In function 'int valid(int)': lant.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.