#477
Lanturi1
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 nu conțin vârful r
.
Problema | Lanturi1 | Operații I/O |
![]() lanturi1.in /lanturi1.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58123441 | Utilizator | |
Fișier | lanturi1.cpp | Dimensiune | 1.23 KB |
Data încărcării | 15 Mai 2025, 10:31 | Scor / rezultat | Eroare de compilare |
lanturi1.cpp:5:5: error: expected ',' or ';' before 'ofstream' ofstream g("lanturi1.out") ^ lanturi1.cpp: In function 'void afis(int)': lanturi1.cpp:9:26: error: 'g' was not declared in this scope for(int i=1;i<=k;i++)g<<x[i]<<" "; ^ lanturi1.cpp:9:29: error: 'x' was not declared in this scope for(int i=1;i<=k;i++)g<<x[i]<<" "; ^ lanturi1.cpp:10:5: error: 'g' was not declared in this scope g<<"\n"; ^ lanturi1.cpp: In function 'int valid(int)': lanturi1.cpp:13:6: error: 'x' was not declared in this scope { if(x[k]==r) return 0; ^ lanturi1.cpp:13:12: error: 'r' was not declared in this scope { if(x[k]==r) return 0; ^ lanturi1.cpp:14:13: error: 'a' was not declared in this scope if(k>=2)if(a[x[k]][x[k-1]]==0) return 0; ^ lanturi1.cpp:14:15: error: 'x' was not declared in this scope if(k>=2)if(a[x[k]][x[k-1]]==0) return 0; ^ lanturi1.cpp: In function 'void bkt(int)': lanturi1.cpp:19:40: error: 'n' was not declared in this scope for(int i=1;i<=n && ok==0;i++) ^ lanturi1.cpp:19:45: error: 'ok' was not declared in this scope for(int i=1;i<=n && ok==0;i++) ^ lanturi1.cpp:20:32: error: 'fr' was not declared in this scope if(fr[i]==0) ^ lanturi1.cpp:21:26: error: 'x' was not declared in this scope {x[k]=i; ^ lanturi1.cpp:23:41: error: 'a' was not declared in this scope if(valid(k))if(a[x[1]][x[k]]==1){ok=1;afis(k);} ^ lanturi1.cpp:23:28: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(valid(k))if(a[x[1]][x[k]]==1){ok=1;afis(k);} ^ lanturi1.cpp: In function 'int main()': lanturi1.cpp:31:28: error: 'n' was not declared in this scope f>>n>>m; ^ lanturi1.cpp:31:31: error: 'm' was not declared in this scope f>>n>>m; ^ lanturi1.cpp:33:38: error: 'a' was not declared in this scope {f>>v1>>v2;; a[v1][v2]=a[v2][v1]=1; m--;} ^ lanturi1.cpp:34:28: error: 'p' was not declared in this scope f>>p>>q>>r; ^ lanturi1.cpp:34:31: error: 'q' was not declared in this scope f>>p>>q>>r; ^ lanturi1.cpp:34:34: error: 'r' was not declared in this scope f>>p>>q>>r; ^ lanturi1.cpp:35:25: error: 'x' was not declared in this scope x[1]=p; ^ lanturi1.cpp:36:25: error: 'fr' was not declared in this scope fr[p]=1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Lanturi1 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ă.