#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 | #57880360 | Utilizator | |
Fișier | lanturi.cpp | Dimensiune | 896 B |
Data încărcării | 29 Aprilie 2025, 08:48 | Scor / rezultat | Eroare de compilare |
lanturi.cpp:4:24: error: empty character constant ofstream out("bac.out")'' ^ lanturi.cpp:4:24: error: expected ',' or ';' before '\x0' lanturi.cpp: In function 'void citire()': lanturi.cpp:8:9: error: 'n' was not declared in this scope in>>n>>m; ^ lanturi.cpp:8:12: error: 'm' was not declared in this scope in>>n>>m; ^ lanturi.cpp:11:13: error: 'x' was not declared in this scope in>>x>>y; ^ lanturi.cpp:11:16: error: 'y' was not declared in this scope in>>x>>y; ^ lanturi.cpp:12:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ lanturi.cpp:14:11: error: 'p' was not declared in this scope in>>p>>q>>r; ^ lanturi.cpp:14:14: error: 'q' was not declared in this scope in>>p>>q>>r; ^ lanturi.cpp:14:17: error: 'r' was not declared in this scope in>>p>>q>>r; ^ lanturi.cpp: In function 'void back(int)': lanturi.cpp:18:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++){ ^ lanturi.cpp:19:5: error: 'st' was not declared in this scope st[k]=i; ^ lanturi.cpp:20:15: error: 'valid' was not declared in this scope if(valid(k)==1) ^ lanturi.cpp:21:17: error: 'solutie' was not declared in this scope if(solutie(k)==1) ^ lanturi.cpp:22:14: error: 'afisare' was not declared in this scope afisare(k); ^ lanturi.cpp:20:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(valid(k)==1) ^ lanturi.cpp: In function 'int valid(int)': lanturi.cpp:28:17: error: expected primary-expression before '<=' token for(int i=1;<=n;i++) ^ lanturi.cpp:28:19: error: 'n' was not declared in this scope for(int i=1;<=n;i++) ^ lanturi.cpp:29:8: error: 'st' was not declared in this scope if(st[k]==st[i]) ^ lanturi.cpp:31:8: error: 'a' was not declared in this scope if(a[st[k]][st[k-1]]==0) ^ lanturi.cpp:31: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:38:8: error: 'st' was not declared in this scope if(st[i]==r) ^ lanturi.cpp:38:15: error: 'r' was not declared in this scope if(st[i]==r) ^ lanturi.cpp:39:5: error: 'ok' was not declared in this scope ok=1; ^ lanturi.cpp:40:8: error: 'st' was not declared in this scope if(st[k]==q and ok==1) ^ lanturi.cpp:40:15: error: 'q' was not declared in this scope if(st[k]==q and ok==1) ^ lanturi.cpp:40:21: error: 'ok' was not declared in this scope if(st[k]==q and ok==1) ^ lanturi.cpp: In function 'void afisare(int)': lanturi.cpp:46:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ lanturi.cpp:47:10: error: 'st' was not declared in this scope out<<st[i]<<" "; ^ lanturi.cpp: In function 'int main()': lanturi.cpp:52:5: error: 'st' was not declared in this scope st[1]=p; ^ lanturi.cpp:52:11: error: 'p' was not declared in this scope st[1]=p; ^ lanturi.cpp: In function 'int solutie(int)': lanturi.cpp:43: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ă.