/in/foo.cc: In function 'void addedge(int, int, int)':
/in/foo.cc:10:5: error: reference to 'next' is ambiguous
next[tot] = head[u];
^~~~
/in/foo.cc:6:10: note: candidates are: int next [1005]
int tot, next[N], head[N], adj[N], w[N], n, m, k, e, d, dis[N], f[N], a[N][N];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/algorithm:61,
from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc: In function 'int Dijkstra()':
/in/foo.cc:56:34: error: reference to 'next' is ambiguous
for(int e = head[minp]; e; e = next[e]) {
^~~~
/in/foo.cc:6:10: note: candidates are: int next [1005]
int tot, next[N], head[N], adj[N], w[N], n, m, k, e, d, dis[N], f[N], a[N][N];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/algorithm:61,
from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~