/in/foo.cc:20:27: error: ISO C++ forbids declaration of 'add_edge' with no type [-fpermissive]
add_edge(int u,int v,int w)
^
/in/foo.cc: In function 'int add_edge(int, int, int)':
/in/foo.cc:26:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
/in/foo.cc: In function 'void dijkstra()':
/in/foo.cc:32:32: error: expression cannot be used as a function
int now=q.top().second();
^
/in/foo.cc:39:50: error: no matching function for call to 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::less<std::pair<int, int> > >::push(int&, int&)'
q.push(dis[edge[i].to],edge[i].to);
^
In file included from /usr/include/c++/7/queue:64:0,
from /in/foo.cc:9:
/usr/include/c++/7/bits/stl_queue.h:595: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::less<std::pair<int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<int, int>]
push(const value_type& __x)
^~~~
/usr/include/c++/7/bits/stl_queue.h:595:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_queue.h:603: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::less<std::pair<int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<int, int>]
push(value_type&& __x)
^~~~
/usr/include/c++/7/bits/stl_queue.h:603:7: note: candidate expects 1 argument, 2 provided
/in/foo.cc: In function 'int main()':
/in/foo.cc:47:9: error: 'i' was not declared in this scope
dis[i]=0;
^