#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 | #27821634 | Utilizator | |
Fișier | lant.cpp | Dimensiune | 833 B |
Data încărcării | 12 Februarie 2021, 10:40 | Scor / rezultat | Eroare de compilare |
lant.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream fout("lant.out") ^ lant.cpp: In function 'void afisare(int)': lant.cpp:21:9: error: 'fout' was not declared in this scope fout<<st[i]<<" "; ^ lant.cpp:21:15: error: 'st' was not declared in this scope fout<<st[i]<<" "; ^ lant.cpp:22:5: error: 'fout' was not declared in this scope fout<<endl; ^ lant.cpp: In function 'int valid(int)': lant.cpp:26:6: error: 'i' was not declared in this scope for(i=1;i<=k-1;i++) ^ lant.cpp:27:12: error: 'st' was not declared in this scope if(st[k]==st[i]) ^ lant.cpp: In function 'void back(int)': lant.cpp:33:17: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ lant.cpp:35:6: error: 'st' was not declared in this scope st[k]=1; ^ lant.cpp:37:16: error: 'a' was not declared in this scope if(a[st[k][st[k-1]]==1) ^ lant.cpp:37:35: error: expected ']' before ')' token if(a[st[k][st[k-1]]==1) ^ lant.cpp:38:28: error: 'q' was not declared in this scope if(st[k]==q) ^ lant.cpp:37:15: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(a[st[k][st[k-1]]==1) ^ lant.cpp: In function 'int main()': lant.cpp:46:9: error: 'a' was not declared in this scope citire(a,n,m) ^ lant.cpp:46:11: error: 'n' was not declared in this scope citire(a,n,m) ^ lant.cpp:46:13: error: 'm' was not declared in this scope citire(a,n,m) ^ lant.cpp:47:9: error: expected ';' before 'st' st[1]=p; ^
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ă.