/in/foo.cc: In function 'int main()':
/in/foo.cc:18:5: error: reference to 'next' is ambiguous
     next[t[color[i]]]=i;
     ^~~~
/in/foo.cc:8:34: note: candidates are: int next [100001]
 int number[100001],color[100001],next[100001],t[100001];
                                  ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:4:
/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:24:12: error: reference to 'next' is ambiguous
      while(next[x]!=0)
            ^~~~
/in/foo.cc:8:34: note: candidates are: int next [100001]
 int number[100001],color[100001],next[100001],t[100001];
                                  ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:4:
/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:26:9: error: reference to 'next' is ambiguous
       x=next[x];
         ^~~~
/in/foo.cc:8:34: note: candidates are: int next [100001]
 int number[100001],color[100001],next[100001],t[100001];
                                  ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:4:
/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:11:8: warning: unused variable 'j' [-Wunused-variable]
  int i,j,x,y;
        ^
/in/foo.cc:11:12: warning: unused variable 'y' [-Wunused-variable]
  int i,j,x,y;
            ^