#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 | #62506525 | Utilizator | |
| Fișier | roy-warshall.cpp | Dimensiune | 455 B |
| Data încărcării | 23 Ianuarie 2026, 12:40 | Scor/rezultat | Eroare de compilare |
roy-warshall.cpp: In function 'int main()': roy-warshall.cpp:5:10: error: 'n' was not declared in this scope cin >>n >> m; ^ roy-warshall.cpp:5:15: error: 'm' was not declared in this scope cin >>n >> m; ^ roy-warshall.cpp:7:15: error: 'x' was not declared in this scope cin >> x >> y; ^ roy-warshall.cpp:7:20: error: 'y' was not declared in this scope cin >> x >> y; ^ roy-warshall.cpp:8:8: error: 'a' was not declared in this scope a[x][y] = 1; ^ roy-warshall.cpp:13:7: error: 'a' was not declared in this scope if(a[i][j] == 0 && a[i][k] == 1 && a[k][j] == 1) ^ roy-warshall.cpp:15:4: error: expected ';' before 'for' for(int i = 1; i <= n; i++){ ^ roy-warshall.cpp:15:19: error: 'i' was not declared in this scope for(int i = 1; i <= n; i++){ ^ roy-warshall.cpp:15:30: error: expected ';' before ')' token for(int 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ă.