#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 | #63572010 | Utilizator | |
| Fișier | roy-warshall.cpp | Dimensiune | 943 B |
| Data încărcării | 10 Martie 2026, 07:43 | Scor/rezultat | Eroare de compilare |
roy-warshall.cpp:6:1: error: expected ',' or ';' before 'int' 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 cin>>n>>m; ^ roy-warshall.cpp:12:13: error: 'm' was not declared in this scope cin>>n>>m; ^ roy-warshall.cpp:17:9: error: 'a' was not declared in this scope a[x][y]=1; ^ roy-warshall.cpp: In function 'void RoyWarshall()': roy-warshall.cpp:27:16: error: 'n' was not declared in this scope for(k=1;k<=n;k++) ^ roy-warshall.cpp:30:20: error: 'a' was not declared in this scope 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 for(i=1;i<=n;i++){ ^ roy-warshall.cpp:39:19: error: 'a' was not declared in this scope 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ă.