#589
Roy-Floyd
Se dă un graf orientat ponderat cu n
noduri și m
arce – în care fiecare arc are asociat un cost, număr natural strict pozitiv. Folosind algoritmul Roy-Floyd, construiți matricea costurilor minime.
Problema | Roy-Floyd | Operații I/O |
roy-floyd.in /roy-floyd.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49731458 | Utilizator | |
Fișier | roy-floyd.cpp | Dimensiune | 789 B |
Data încărcării | 13 Martie 2024, 13:45 | Scor / rezultat | Eroare de compilare |
roy-floyd.cpp:4:30: error: expected unqualified-id before '/' token ofstream g("roy-floyd.out");*/ ^ roy-floyd.cpp:4:30: error: expected constructor, destructor, or type conversion before '/' token roy-floyd.cpp: In function 'void citire()': roy-floyd.cpp:8:5: error: 'cin' was not declared in this scope cin>>n>>m; ^ roy-floyd.cpp:8:10: error: 'n' was not declared in this scope cin>>n>>m; ^ roy-floyd.cpp:8:13: error: 'm' was not declared in this scope cin>>n>>m; ^ roy-floyd.cpp:11:18: error: 'c' was not declared in this scope if(i!=j) c[i][j]=-1; ^ roy-floyd.cpp:13:14: error: 'x' was not declared in this scope cin>>x>>y>>cost; ^ roy-floyd.cpp:13:17: error: 'y' was not declared in this scope cin>>x>>y>>cost; ^ roy-floyd.cpp:13:20: error: 'cost' was not declared in this scope cin>>x>>y>>cost; ^ roy-floyd.cpp:14:5: error: 'c' was not declared in this scope c[x][y]=cost; ^ roy-floyd.cpp:14:7: error: 'x' was not declared in this scope c[x][y]=cost; ^ roy-floyd.cpp:14:10: error: 'y' was not declared in this scope c[x][y]=cost; ^ roy-floyd.cpp:14:13: error: 'cost' was not declared in this scope c[x][y]=cost; ^ roy-floyd.cpp: In function 'void roy_floyd()': roy-floyd.cpp:18:22: error: 'n' was not declared in this scope for (int k=1; k<=n; k++) ^ roy-floyd.cpp:21:39: error: 'c' was not declared in this scope if (i!=k &&j!=k &&i!=j && c[i][j]>c[i][k]+c[k][j]) ^ roy-floyd.cpp: In function 'void afisare()': roy-floyd.cpp:26:22: error: 'n' was not declared in this scope for (int i=1; i<=n; i++) ^ roy-floyd.cpp:28:9: error: 'cout' was not declared in this scope cout<<c[i][j]<<" "; ^ roy-floyd.cpp:28:15: error: 'c' was not declared in this scope cout<<c[i][j]<<" "; ^ roy-floyd.cpp:29:9: error: 'cout' was not declared in this scope cout<<endl;} ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Roy-Floyd 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ă.