#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 | #56260774 | Utilizator | |
| Fișier | roy-warshall.cpp | Dimensiune | 874 B |
| Data încărcării | 11 Februarie 2025, 23:19 | Scor/rezultat | Eroare de compilare |
roy-warshall.cpp: In function 'int main()': roy-warshall.cpp:8:5: error: 'vector' is not a member of 'std' std::vector<std::vector<int>> adj_matrix(nodes_cnt + 1, std::vector<int>(nodes_cnt + 1, 0)); ^ roy-warshall.cpp:8:17: error: 'vector' is not a member of 'std' std::vector<std::vector<int>> adj_matrix(nodes_cnt + 1, std::vector<int>(nodes_cnt + 1, 0)); ^ roy-warshall.cpp:8:29: error: expected primary-expression before 'int' std::vector<std::vector<int>> adj_matrix(nodes_cnt + 1, std::vector<int>(nodes_cnt + 1, 0)); ^ roy-warshall.cpp:8:29: error: expected ';' before 'int' roy-warshall.cpp:12:9: error: 'adj_matrix' was not declared in this scope adj_matrix[x][y] = 1; ^ roy-warshall.cpp:18:21: error: 'adj_matrix' was not declared in this scope if (adj_matrix[i][j] == 0 && adj_matrix[i][k] && adj_matrix[k][j]) { ^ roy-warshall.cpp:27:26: error: 'adj_matrix' was not declared in this scope std::cout << adj_matrix[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ă.