Borderou de evaluare (job #2655488)
Utilizator | Data | 4 octombrie 2020 15:52:10 | |
---|---|---|---|
Problema | Algoritmul lui Dijkstra | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:163:14: error: '__fast_unordered_map' is not a member of 'std'
std::vector<std::unordered_map<size_t, int>> costs;
^~~
main.cpp:163:14: note: suggested alternative:
main.cpp:7:66: note: '__fast_unordered_map'
using unordered_map = __gnu_pbds::gp_hash_table<Key, Value, Hash>;
^
main.cpp:163:14: error: '__fast_unordered_map' is not a member of 'std'
std::vector<std::unordered_map<size_t, int>> costs;
^~~
main.cpp:163:14: note: suggested alternative:
main.cpp:7:66: note: '__fast_unordered_map'
using unordered_map = __gnu_pbds::gp_hash_table<Key, Value, Hash>;
^
main.cpp:163:41: error: template argument 1 is invalid
std::vector<std::unordered_map<size_t, int>> costs;
^~~
main.cpp:163:44: error: expected unqualified-id before '>' token
std::vector<std::unordered_map<size_t, int>> costs;
^~
main.cpp: In constructor 'directed_graph::directed_graph(const size_t&)':
main.cpp:170:3: error: 'costs' was not declared in this scope
costs.resize(nodes_count + 1, {});
^~~~~
main.cpp: In member function 'void directed_graph::add_cost(const size_t&, const size_t&, const int&)':
main.cpp:184:3: error: 'costs' was not declared in this scope
costs[source][destination] = cost;
^~~~~
main.cpp: In member function 'std::vector<int> directed_graph::run_dijkstra(const size_t&)':
main.cpp:204:34: error: 'costs' was not declared in this scope
if (ret[next_node] > cost + costs[node][next_node])
^~~~~
main.cpp:206:61: 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>)'
heap.push({ cost + costs[node][next_node], next_node });
^
In file included from /usr/include/c++/6/queue:64:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:86,
from main.cpp:3:
/usr/include/c++/6/bits/stl_queue.h:558:7: note: candidate: 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++/6/bits/stl_queue.h:558: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++/6/bits/stl_queue.h:566:7: note: candidate: 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++/6/bits/stl_queue.h:566: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>&&}'
main.cpp: In function 'int32_t main()':
main.cpp:223:36: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
freopen("dijkstra.in", "w", stdin);
^
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !