#588
Dijkstra
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 | #49070177 | Utilizator | |
Fișier | dijkstra.cpp | Dimensiune | 1.06 KB |
Data încărcării | 14 Februarie 2024, 11:54 | Scor / rezultat | Eroare de compilare |
dijkstra.cpp:13:1: error: 'vector' does not name a type vector <PI> G[100001]; ^ dijkstra.cpp: In function 'void dijkstra(int)': dijkstra.cpp:16:5: error: 'priority_queue' was not declared in this scope priority_queue < PI , vector<PI> , greater<PI> > Q; ^ dijkstra.cpp:16:25: error: expected primary-expression before ',' token priority_queue < PI , vector<PI> , greater<PI> > Q; ^ dijkstra.cpp:16:27: error: 'vector' was not declared in this scope priority_queue < PI , vector<PI> , greater<PI> > Q; ^ dijkstra.cpp:16:36: error: expected primary-expression before '>' token priority_queue < PI , vector<PI> , greater<PI> > Q; ^ dijkstra.cpp:16:38: error: expected primary-expression before ',' token priority_queue < PI , vector<PI> , greater<PI> > Q; ^ dijkstra.cpp:16:52: error: expected primary-expression before '>' token priority_queue < PI , vector<PI> , greater<PI> > Q; ^ dijkstra.cpp:16:54: error: 'Q' was not declared in this scope priority_queue < PI , vector<PI> , greater<PI> > Q; ^ dijkstra.cpp:25:20: error: 'G' was not declared in this scope for(auto& q:G[y]) ^ dijkstra.cpp: In function 'int main()': dijkstra.cpp:41:9: error: 'G' was not declared in this scope G[x].push_back({y , w}); ^ dijkstra.cpp:43:16: error: 'Inf' was not declared in this scope D[i] = Inf; ^ dijkstra.cpp:46:20: error: 'Inf' was not declared in this scope if(D[i] == Inf) cout << "-1 "; ^
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ă.