railway_trip.cpp: In function 'int main()':
railway_trip.cpp:41:4: error: reference to 'next' is ambiguous
next[0][i][j] = prev;
^~~~
railway_trip.cpp:5:5: note: candidates are: int next [2][100000][101]
int next[2][100000][101]; // next stop of level <= j, you are <= j+1 (taking trains of j+1)
^~~~
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/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from railway_trip.cpp: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
^~~~
railway_trip.cpp:49:4: error: reference to 'next' is ambiguous
next[1][i][j] = prev;
^~~~
railway_trip.cpp:5:5: note: candidates are: int next [2][100000][101]
int next[2][100000][101]; // next stop of level <= j, you are <= j+1 (taking trains of j+1)
^~~~
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/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from railway_trip.cpp: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
^~~~
railway_trip.cpp:61:29: error: reference to 'next' is ambiguous
newstuff[0] = make_pair(next[0][stuff[p][0].first ][j], 1000000000);
^~~~
railway_trip.cpp:5:5: note: candidates are: int next [2][100000][101]
int next[2][100000][101]; // next stop of level <= j, you are <= j+1 (taking trains of j+1)
^~~~
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/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from railway_trip.cpp: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
^~~~
railway_trip.cpp:62:29: error: reference to 'next' is ambiguous
newstuff[1] = make_pair(next[1][stuff[p][1].first ][j], 1000000000);
^~~~
railway_trip.cpp:5:5: note: candidates are: int next [2][100000][101]
int next[2][100000][101]; // next stop of level <= j, you are <= j+1 (taking trains of j+1)
^~~~
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/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from railway_trip.cpp: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
^~~~
railway_trip.cpp:69:20: error: reference to 'next' is ambiguous
int newloc = next[dir][loc][j];
^~~~
railway_trip.cpp:5:5: note: candidates are: int next [2][100000][101]
int next[2][100000][101]; // next stop of level <= j, you are <= j+1 (taking trains of j+1)
^~~~
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/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from railway_trip.cpp: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
^~~~