#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 | #64639626 | Utilizator | |
| Fișier | roy-warshall.cpp | Dimensiune | 887 B |
| Data încărcării | 19 Mai 2026, 21:14 | Scor/rezultat | Eroare de compilare |
roy-warshall.cpp:11:1: error: ISO C++ forbids declaration of ‘rw’ with no type [-fpermissive] 11 | rw(){ | ^~ roy-warshall.cpp: In function ‘int rw()’: roy-warshall.cpp:13:16: error: ‘n’ was not declared in this scope 13 | for(k=1;k<=n;k++) | ^ roy-warshall.cpp:16:8: error: ‘a’ was not declared in this scope 16 | if(a[i][j]==0) a[i][j]=a[i][k]*a[k][j]; | ^ roy-warshall.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type] 17 | } | ^ roy-warshall.cpp: In function ‘void citire()’: roy-warshall.cpp:20:10: error: ‘n’ was not declared in this scope 20 | cin>>n>>m; | ^ roy-warshall.cpp:20:13: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 20 | cin>>n>>m; | ^ | tm roy-warshall.cpp:23:18: error: ‘x’ was not declared in this scope 23 | cin>>x>>y; | ^ roy-warshall.cpp:23:21: error: ‘y’ was not declared in this scope 23 | cin>>x>>y; | ^ roy-warshall.cpp:24:18: error: ‘a’ was not declared in this scope 24 | cin>>a[x][y]; | ^ roy-warshall.cpp: In function ‘int main()’: roy-warshall.cpp:32:21: error: ‘n’ was not declared in this scope 32 | for(int i =1;i<=n;i++){ | ^ roy-warshall.cpp:33:38: error: ‘a’ was not declared in this scope 33 | for(int j=1;j<=n;j++){ cout<<a[i][j]<<" "; | ^ roy-warshall.cpp:37:2: error: expected ‘}’ at end of input 37 | } | ^ roy-warshall.cpp:29:11: note: to match this ‘{’ 29 | int main(){ | ^
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ă.