#4027
LongestPath
Se dă un graf orientat aciclic (adică nu există circuite). Lungimea unui drum elementar este dată de numărul de arce. Să se determine lungimea maximă a unui drum elementar în acest graf orientat aciclic.
Folclorul informatic
Problema | LongestPath | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 128 MB
/
Stivă 64 MB
|
Id soluție | #58568622 | Utilizator | |
Fișier | longestpath.cpp | Dimensiune | 1.36 KB |
Data încărcării | 20 Iunie 2025, 19:29 | Scor / rezultat | Eroare de compilare |
longestpath.cpp:11:11: error: size of array 'urm1' is too large urm1[30005], urm2[30005]; ^ longestpath.cpp:11:24: error: size of array 'urm2' is too large urm1[30005], urm2[30005]; ^ longestpath.cpp: In function 'void setUrm(int, int, bool)': longestpath.cpp:17:9: error: 'urm1' was not declared in this scope urm1[num].v[who] = val; ^ longestpath.cpp:21:9: error: 'urm2' was not declared in this scope urm2[num - 49999].v[who] = val; ^ longestpath.cpp: In function 'bool acsUrm(int, int)': longestpath.cpp:29:16: error: 'urm1' was not declared in this scope return urm1[num].v[who]; ^ longestpath.cpp:33:16: error: 'urm2' was not declared in this scope return urm2[num - 49999].v[who]; ^ longestpath.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LongestPath 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ă.