#476
Se dă lista muchiilor unui graf neorientat cu n
vârfuri și trei vârfuri p q r
. Să se determine toate lanțurile elementare cu extremitățile în p
și q
care conțin vârful r
.
Problema | Lanturi | Operații I/O |
![]() lanturi.in /lanturi.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57897960 | Utilizator | |
Fișier | lanturi.cpp | Dimensiune | 1.01 KB |
Data încărcării | 29 Aprilie 2025, 19:11 | Scor / rezultat | Eroare de compilare |
lanturi.cpp:6:1: error: expected ',' or ';' before 'int' int n,m, a[21][21],st[21],p,q,r; ^ lanturi.cpp: In function 'void citire(int, int)': lanturi.cpp:9:5: error: 'fin' was not declared in this scope fin>>n>>m; ^ lanturi.cpp:12:14: error: 'x' was not declared in this scope fin>>x>>y; ^ lanturi.cpp:12:17: error: 'y' was not declared in this scope fin>>x>>y; ^ lanturi.cpp:13:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ lanturi.cpp:15:10: error: 'p' was not declared in this scope fin>>p>>q>>r; ^ lanturi.cpp:15:13: error: 'q' was not declared in this scope fin>>p>>q>>r; ^ lanturi.cpp:15:16: error: 'r' was not declared in this scope fin>>p>>q>>r; ^ lanturi.cpp: In function 'void back(int)': lanturi.cpp:19:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ lanturi.cpp:21:9: error: 'st' was not declared in this scope st[k]=i; ^ lanturi.cpp:22:19: error: 'valid' was not declared in this scope if(valid(k)==1) ^ lanturi.cpp:23:25: error: 'solutie' was not declared in this scope if(solutie(k)==1) ^ lanturi.cpp:24:23: error: 'afisare' was not declared in this scope afisare(k); ^ lanturi.cpp:22:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(valid(k)==1) ^ lanturi.cpp: In function 'int valid(int)': lanturi.cpp:32:12: error: 'st' was not declared in this scope if(st[i]==st[k]) ^ lanturi.cpp:34:8: error: 'a' was not declared in this scope if(a[st[k]][st[k-1]]==0) ^ lanturi.cpp:34:10: error: 'st' was not declared in this scope if(a[st[k]][st[k-1]]==0) ^ lanturi.cpp: In function 'int solutie(int)': lanturi.cpp:42:12: error: 'st' was not declared in this scope if(st[i]==r) ^ lanturi.cpp:42:19: error: 'r' was not declared in this scope if(st[i]==r) ^ lanturi.cpp:44:8: error: 'st' was not declared in this scope if(st[k]==q && ok==1) ^ lanturi.cpp:44:15: error: 'q' was not declared in this scope if(st[k]==q && ok==1) ^ lanturi.cpp: In function 'void afisare(int)': lanturi.cpp:52:9: error: 'fout' was not declared in this scope fout<<st[i]; ^ lanturi.cpp:52:15: error: 'st' was not declared in this scope fout<<st[i]; ^ lanturi.cpp:53:5: error: 'fout' was not declared in this scope fout<<endl; ^ lanturi.cpp: In function 'int main()': lanturi.cpp:57:9: error: too few arguments to function 'void citire(int, int)' citire(); ^ lanturi.cpp:7:6: note: declared here void citire(int n, int m) ^ lanturi.cpp:58:5: error: 'st' was not declared in this scope st[1]=p; ^ lanturi.cpp:58:11: error: 'p' was not declared in this scope st[1]=p; ^ lanturi.cpp: In function 'int solutie(int)': lanturi.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Lanturi 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ă.