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