/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void dijkstra()':
/in/foo.cc:52:9: error: 'st' was not declared in this scope
     dis[st] = 0;
         ^~
/in/foo.cc:53:19: error: no matching function for call to 'std::priority_queue<std::pair<long long int, int>, std::vector<std::pair<long long int, int> >, std::greater<std::pair<long long int, int> > >::push(<brace-enclosed initializer list>)'
     q.push({0, st});
                   ^
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 /in/foo.cc:1:
/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<long long int, int>; _Sequence = std::vector<std::pair<long long int, int> >; _Compare = std::greater<std::pair<long long int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<long long 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<long long 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<long long int, int>; _Sequence = std::vector<std::pair<long long int, int> >; _Compare = std::greater<std::pair<long long int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<long long 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<long long int, int>, std::vector<std::pair<long long int, int> >, std::greater<std::pair<long long int, int> > >::value_type&& {aka std::pair<long long int, int>&&}'
/in/foo.cc: In function 'int main()':
/in/foo.cc:92:5: error: 'st' was not declared in this scope
     st = 1;
     ^~

信息

递交者
类型
递交
题目
P1404 遭遇战
语言
C++
递交时间
2019-10-15 01:10:09
评测时间
2019-10-15 01:10:09
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes