#479
Se dă lista muchiilor unui graf neorientat cu n
vârfuri și două vârfuri p q
. Să se determine cel mai lung lanț elementar cu extremitățile p
și q
.
Problema | LantMaxim | Operații I/O |
![]() lantmaxim.in /lantmaxim.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58122973 | Utilizator | |
Fișier | lantmaxim.cpp | Dimensiune | 761 B |
Data încărcării | 15 Mai 2025, 10:21 | Scor / rezultat | Eroare de compilare |
lantmaxim.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream g ("lantmaxim.out") ^ lantmaxim.cpp: In function 'void copie(int)': lantmaxim.cpp:10:9: error: 'y' was not declared in this scope y[i]=x[i]; ^ lantmaxim.cpp:10:14: error: 'x' was not declared in this scope y[i]=x[i]; ^ lantmaxim.cpp: In function 'int valid(int)': lantmaxim.cpp:16:12: error: 'a' was not declared in this scope if(a[x[k]][x[k-1]]==0) ^ lantmaxim.cpp:16:14: error: 'x' was not declared in this scope if(a[x[k]][x[k-1]]==0) ^ lantmaxim.cpp: In function 'void bkt(int)': lantmaxim.cpp:21:17: error: 'n' was not declared in this scope {for(int i=1;i<=n;i++) ^ lantmaxim.cpp:22:8: error: 'fr' was not declared in this scope if(fr[i]==0) ^ lantmaxim.cpp:23:2: error: 'x' was not declared in this scope {x[k]=i; ^ lantmaxim.cpp:25:23: error: 'q' was not declared in this scope if(valid(k))if(x[k]==q){if(k>lgmax){lgmax=k;copie(k);}} ^ lantmaxim.cpp:25:31: error: 'lgmax' was not declared in this scope if(valid(k))if(x[k]==q){if(k>lgmax){lgmax=k;copie(k);}} ^ lantmaxim.cpp:25:4: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(valid(k))if(x[k]==q){if(k>lgmax){lgmax=k;copie(k);}} ^ lantmaxim.cpp: In function 'int main()': lantmaxim.cpp:33:8: error: 'n' was not declared in this scope f>>n>>m; ^ lantmaxim.cpp:33:11: error: 'm' was not declared in this scope f>>n>>m; ^ lantmaxim.cpp:36:6: error: 'a' was not declared in this scope a[v1][v2]=a[v2][v1]=1; m--;} ^ lantmaxim.cpp:37:8: error: 'p' was not declared in this scope f>>p>>q>>r; ^ lantmaxim.cpp:37:11: error: 'q' was not declared in this scope f>>p>>q>>r; ^ lantmaxim.cpp:37:14: error: 'r' was not declared in this scope f>>p>>q>>r; ^ lantmaxim.cpp:38:5: error: 'x' was not declared in this scope x[1]=p; ^ lantmaxim.cpp:39:5: error: 'fr' was not declared in this scope fr[p]=1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LantMaxim 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ă.