#1887
Dijkstra2
Dijkstra are nevoie de ajutorul vostru pentru a-și duce la bun sfârșit datoria. Acesta vrea să afle drumurile de lungime minimă de la casa prietenului său Vlad la celelalte case ale vecinilor. Nu are foarte mult timp la dispoziție așa ca trebuie să vă mișcați repede. Îl veți ajuta?
Problema | Dijkstra2 | Operații I/O |
dijkstra2.in /dijkstra2.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51842984 | Utilizator | |
Fișier | dijkstra2.cpp | Dimensiune | 1.47 KB |
Data încărcării | 28 August 2024, 14:41 | Scor / rezultat | Eroare de compilare |
dijkstra2.cpp: In function 'void dijkstra()': dijkstra2.cpp:13:103: error: wrong number of template arguments (0, should be 1) priority_queue<pair<unsigned int, unsigned int>, vector<pair<unsigned int, unsigned int>>, greater<>> pq; ^ In file included from /usr/include/c++/4.8/string:48:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from dijkstra2.cpp:1: /usr/include/c++/4.8/bits/stl_function.h:222:12: error: provided for 'template<class _Tp> struct std::greater' struct greater : public binary_function<_Tp, _Tp, bool> ^ dijkstra2.cpp:13:104: error: template argument 3 is invalid priority_queue<pair<unsigned int, unsigned int>, vector<pair<unsigned int, unsigned int>>, greater<>> pq; ^ dijkstra2.cpp:13:109: error: invalid type in declaration before ';' token priority_queue<pair<unsigned int, unsigned int>, vector<pair<unsigned int, unsigned int>>, greater<>> pq; ^ dijkstra2.cpp:14:8: error: request for member 'emplace' in 'pq', which is of non-class type 'int' pq.emplace(0, start); ^ dijkstra2.cpp:17:15: error: request for member 'empty' in 'pq', which is of non-class type 'int' while(!pq.empty()) { ^ dijkstra2.cpp:18:39: error: request for member 'top' in 'pq', which is of non-class type 'int' unsigned int currentNode = pq.top().second; ^ dijkstra2.cpp:19:39: error: request for member 'top' in 'pq', which is of non-class type 'int' unsigned int currentDist = pq.top().first; ^ dijkstra2.cpp:20:12: error: request for member 'pop' in 'pq', which is of non-class type 'int' pq.pop(); ^ dijkstra2.cpp:29:20: error: request for member 'emplace' in 'pq', which is of non-class type 'int' pq.emplace(dist[nodeVal], nodeVal); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dijkstra2 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ă.