#4638
Dmaxk
Se dă un graf neorientat cu n
vârfuri, m
muchii și un vârf k
. Să se determine vârfurile cele mai îndepărtate de vârful k
.
Problema | Dmaxk | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53339548 | Utilizator | |
Fișier | dmaxk.cpp | Dimensiune | 1.05 KB |
Data încărcării | 25 Octombrie 2024, 01:27 | Scor / rezultat | Eroare de compilare |
dmaxk.cpp: In function 'void dijkstra(int)': dmaxk.cpp:21:13: error: expected unqualified-id before '[' token auto[dist,CurrentNode]=pq.top(); ^ dmaxk.cpp:23:28: error: 'CurrentNode' was not declared in this scope for(auto nod:graph[CurrentNode]) ^ dmaxk.cpp:25:23: error: 'dist' was not declared in this scope if(d[nod]>dist+1) ^ dmaxk.cpp:28:37: error: no matching function for call to 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > >::push(<brace-enclosed initializer list>)' pq.push({d[nod],nod}); ^ dmaxk.cpp:28:37: note: candidates are: In file included from /usr/include/c++/4.8/queue:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:85, from dmaxk.cpp:1: /usr/include/c++/4.8/bits/stl_queue.h:496:7: note: void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int> >; _Compare = std::greater<std::pair<int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<int, int>] push(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_queue.h:496:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, int>&}' /usr/include/c++/4.8/bits/stl_queue.h:504:7: note: void std::priority_queue<_Tp, _Sequence, _Compare>::push(std::priority_queue<_Tp, _Sequence, _Compare>::value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int> >; _Compare = std::greater<std::pair<int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<int, int>] push(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_queue.h:504:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > >::value_type&& {aka std::pair<int, int>&&}'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dmaxk 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ă.