foo.cc: In function 'void add(int, int, int)':
foo.cc:21:5: error: reference to 'next' is ambiguous
21 | next[num]=first[u];
| ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_algobase.h:66,
from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/algorithm:61,
from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
213 | next(_InputIterator __x, typename
| ^~~~
foo.cc:11:21: note: 'int next [100007]'
11 | int num,first[MAXN],next[MAXM],arr[MAXM],cost[MAXM];
| ^~~~
foo.cc: In function 'void init()':
foo.cc:31:12: error: reference to 'next' is ambiguous
31 | memset(next,0,sizeof(next));
| ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_algobase.h:66,
from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/algorithm:61,
from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
213 | next(_InputIterator __x, typename
| ^~~~
foo.cc:11:21: note: 'int next [100007]'
11 | int num,first[MAXN],next[MAXM],arr[MAXM],cost[MAXM];
| ^~~~
foo.cc:31:26: error: reference to 'next' is ambiguous
31 | memset(next,0,sizeof(next));
| ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_algobase.h:66,
from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/algorithm:61,
from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
213 | next(_InputIterator __x, typename
| ^~~~
foo.cc:11:21: note: 'int next [100007]'
11 | int num,first[MAXN],next[MAXM],arr[MAXM],cost[MAXM];
| ^~~~
foo.cc: In function 'bool pan(int)':
foo.cc:51:37: error: reference to 'next' is ambiguous
51 | for (int i=first[u];i!=-1;i=next[i])
| ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_algobase.h:66,
from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/algorithm:61,
from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
213 | next(_InputIterator __x, typename
| ^~~~
foo.cc:11:21: note: 'int next [100007]'
11 | int num,first[MAXN],next[MAXM],arr[MAXM],cost[MAXM];
| ^~~~
foo.cc: In function 'void solve(int)':
foo.cc:85:37: error: reference to 'next' is ambiguous
85 | for (int i=first[u];i!=-1;i=next[i])
| ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_algobase.h:66,
from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/algorithm:61,
from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
213 | next(_InputIterator __x, typename
| ^~~~
foo.cc:11:21: note: 'int next [100007]'
11 | int num,first[MAXN],next[MAXM],arr[MAXM],cost[MAXM];
| ^~~~
[Hydro](https://hydro.ac)提供评测服务