#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 | #58123593 | Utilizator | |
Fișier | lantmaxim.cpp | Dimensiune | 1.02 KB |
Data încărcării | 15 Mai 2025, 10:34 | Scor / rezultat | Eroare de compilare |
lantmaxim.cpp: In function 'void copie(int)': lantmaxim.cpp:8:10: error: 'i' was not declared in this scope {for(i=1;i<=k;i++)y[i]=x[i]; ^ lantmaxim.cpp: In function 'int valid(int)': lantmaxim.cpp:12:30: error: two consecutive '[' shall only introduce an attribute before '[' token if(k>=2) if(a[x[k]][x[[k-1]]==0) ^ lantmaxim.cpp:12:30: error: expected ']' before '[' token lantmaxim.cpp:12:30: error: two consecutive '[' shall only introduce an attribute before '[' token lantmaxim.cpp:12:30: error: expected ')' before '[' token lantmaxim.cpp:14:29: error: 'retirn' was not declared in this scope retirn 1; ^ lantmaxim.cpp:14:36: error: expected ';' before numeric constant retirn 1; ^ lantmaxim.cpp: In function 'void bkt(int)': lantmaxim.cpp:21:29: error: 'q' was not declared in this scope if(valid (k)) if(x[k]==q)(if(k>lgmax){lgmax=k; ^ lantmaxim.cpp:21:32: error: expected primary-expression before 'if' if(valid (k)) if(x[k]==q)(if(k>lgmax){lgmax=k; ^ lantmaxim.cpp:21:32: error: expected ')' before 'if' lantmaxim.cpp:24:32: error: expected ';' before '}' token } else bkt(k+1); ^ lantmaxim.cpp: In function 'int main()': lantmaxim.cpp:33:17: error: 'q' was not declared in this scope f>>p>>q; ^ lantmaxim.cpp:37:26: error: 'lfmax' was not declared in this scope for(int i=1;i<=lfmax;i++)g<<y[i]<<" "; ^ lantmaxim.cpp:39:7: error: expected '}' at end of input } ^ lantmaxim.cpp: In function 'int valid(int)': lantmaxim.cpp:15:5: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.