#588
Se dă un graf orientat ponderat – în care fiecare arc are asociat un cost, număr natural strict pozitiv, și un nod p. Să se determine, folosind algoritmul lui Dijkstra, costul minim al drumului de la p la fiecare nod al grafului.
| Problema | Dijkstra | Operații I/O |
dijkstra.in/dijkstra.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #58768035 | Utilizator | |
| Fișier | dijkstra.cpp | Dimensiune | 2.09 KB |
| Data încărcării | 04 August 2025, 18:35 | Scor/rezultat | Eroare de compilare |
dijkstra.cpp:56:1: error: 'include' does not name a type include <iostream> ^ dijkstra.cpp:66:5: error: redefinition of 'int n' int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:11:5: error: 'int n' previously declared here int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:66:8: error: redefinition of 'int p' int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:11:8: error: 'int p' previously declared here int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:66:11: error: redefinition of 'int x' int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:11:11: error: 'int x' previously declared here int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:66:14: error: redefinition of 'int y' int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:11:14: error: 'int y' previously declared here int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:66:17: error: redefinition of 'int c' int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:11:17: error: 'int c' previously declared here int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:66:26: error: redefinition of 'int dp [200]' int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:11:20: error: 'int dp [200]' previously declared here int n, p, x, y, c, dp[200]; ^ dijkstra.cpp:67:29: error: redefinition of 'std::vector<std::pair<int, int> > gf [200]' vector<pair<int,int>> gf[200]; ^ dijkstra.cpp:12:23: error: 'std::vector<std::pair<int, int> > gf [200]' previously declared here vector<pair<int,int>> gf[200]; ^ dijkstra.cpp:68:76: error: redefinition of 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > > pq' priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> pq; ^ dijkstra.cpp:13:76: error: 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > > pq' previously declared here priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> pq; ^ dijkstra.cpp: In function 'void bfs(int)': dijkstra.cpp:72:6: error: redefinition of 'void bfs(int)' void bfs(int start) ^ dijkstra.cpp:17:6: error: 'void bfs(int)' previously defined here void bfs(int start) ^ dijkstra.cpp: In function 'int main()': dijkstra.cpp:95:5: error: redefinition of 'int main()' int main() ^ dijkstra.cpp:40:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dijkstra 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ă.