#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 | tastatură/ecran |
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 128 MB
/
Stivă 64 MB
|
Id soluție | #50337132 | Utilizator | |
Fișier | longestpath.cpp | Dimensiune | 602 B |
Data încărcării | 05 Aprilie 2024, 08:43 | Scor / rezultat | Eroare de compilare |
longestpath.cpp:4:31: error: size of array 'a' is too large int n,m,maxim,a[100001][200001]; ^ longestpath.cpp: In function 'void citire()': longestpath.cpp:12:13: error: 'a' was not declared in this scope a[x][y]=1; ^ longestpath.cpp: In function 'void drum()': longestpath.cpp:20:8: error: 'a' was not declared in this scope if(a[i][j]<a[i][k]+a[k][j] and a[i][k]>0 and a[k][j]>0) ^ longestpath.cpp: In function 'int main()': longestpath.cpp:31:8: error: 'a' was not declared in this scope if(a[i][j]>maxim ) maxim=a[i][j]; ^
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ă.