#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 | #64539816 | Utilizator | |
| Fișier | roy-warshall.cpp | Dimensiune | 941 B |
| Data încărcării | 13 Mai 2026, 10:37 | Scor/rezultat | Eroare de compilare |
roy-warshall.cpp:6:1: error: expected ‘,’ or ‘;’ before ‘int’ 6 | int a[NMAX][NMAX], n, m; | ^~~ roy-warshall.cpp: In function ‘void citire()’: roy-warshall.cpp:12:10: error: ‘n’ was not declared in this scope 12 | cin>>n>>m; | ^ roy-warshall.cpp:12:13: error: ‘m’ was not declared in this scope 12 | cin>>n>>m; | ^ roy-warshall.cpp:17:9: error: ‘a’ was not declared in this scope 17 | a[x][y]=1; | ^ roy-warshall.cpp: In function ‘void RoyWarshall()’: roy-warshall.cpp:27:16: error: ‘n’ was not declared in this scope 27 | for(k=1;k<=n;k++) | ^ roy-warshall.cpp:30:20: error: ‘a’ was not declared in this scope 30 | if(a[i][k] !=0 && a[k][j]!=0) | ^ roy-warshall.cpp: In function ‘void afisare()’: roy-warshall.cpp:37:16: error: ‘n’ was not declared in this scope 37 | for(i=1;i<=n;i++){ | ^ roy-warshall.cpp:39:19: error: ‘a’ was not declared in this scope 39 | cout<<a[i][j]<<" "; | ^
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ă.