#580
Se dă lista arcelor unui graf orientat. Construiți matricea drumurilor, folosind algoritmul lui Roy-Warshall.
| Problema | Roy-Warshall | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64293236 | Utilizator | |
| Fișier | roy-warshall.cpp | Dimensiune | 478 B |
| Data încărcării | 28 Aprilie 2026, 12:10 | Scor/rezultat | Eroare de compilare |
roy-warshall.cpp: In function ‘int main()’: roy-warshall.cpp:15:27: warning: capture of variable ‘k’ with non-automatic storage duration 15 | if(a[i][k] and [k][j]) | ^ roy-warshall.cpp:3:9: note: ‘int k’ declared here 3 | int i,j,k,m,n,x,y,a[1001][1001]; | ^ roy-warshall.cpp: In lambda function: roy-warshall.cpp:15:29: error: expected ‘{’ before ‘[’ token 15 | if(a[i][k] and [k][j]) | ^ roy-warshall.cpp: In function ‘int main()’: roy-warshall.cpp:15:29: error: no match for ‘operator[]’ (operand types are ‘main()::<lambda()>’ and ‘int’) roy-warshall.cpp:12:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 12 | for(k=1; k<=n; k++) | ^~~ roy-warshall.cpp:17:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 17 | for ( i=1; i<=n ; i++) | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Roy-Warshall 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ă.