/in/foo.cc: In function 'int main()':
/in/foo.cc:14:18: error: reference to 'next' is ambiguous
scanf("%d", &next[i]);
^~~~
/in/foo.cc:8:5: note: candidates are: int next [200005]
int next[MAX], head[MAX], vst[MAX], ord[MAX], s[MAX], cc, cnt, n, ti, ans = INF;
^~~~
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:3:
/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:19:61: error: reference to 'next' is ambiguous
for (int cur = i; vst[cur] == 0 || vst[cur] == i; cur = next[cur]) {
^~~~
/in/foo.cc:8:5: note: candidates are: int next [200005]
int next[MAX], head[MAX], vst[MAX], ord[MAX], s[MAX], cc, cnt, n, ti, ans = INF;
^~~~
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:3:
/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
^~~~