/in/foo.cc: In function 'void add(int, int)':
/in/foo.cc:17:9: error: reference to 'next' is ambiguous
  tot++; next[tot]=point[x]; point[x]=tot; v[tot]=y; 
         ^~~~
/in/foo.cc:10:21: note: candidates are: int next [40030]
 int n,m,point[N*10],next[N*10],v[N*10],dis[N*10],vis[N*10],ans,inf,tot;
                     ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208: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 'void find1(long long int, int, int)':
/in/foo.cc:21:5: warning: unused variable 'l' [-Wunused-variable]
  LL l=minn; LL r=maxn;
     ^
/in/foo.cc:21:16: warning: unused variable 'r' [-Wunused-variable]
  LL l=minn; LL r=maxn;
                ^
/in/foo.cc: In function 'void find2(long long int, int, int)':
/in/foo.cc:35:5: warning: unused variable 'l' [-Wunused-variable]
  LL l=minn; LL r=maxn;
     ^
/in/foo.cc:35:16: warning: unused variable 'r' [-Wunused-variable]
  LL l=minn; LL r=maxn;
                ^
/in/foo.cc: In function 'void bfs()':
/in/foo.cc:90:29: error: reference to 'next' is ambiguous
   for (int i=point[now];i;i=next[i]){
                             ^~~~
/in/foo.cc:10:21: note: candidates are: int next [40030]
 int n,m,point[N*10],next[N*10],v[N*10],dis[N*10],vis[N*10],ans,inf,tot;
                     ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~