foo.cpp: In function 'int main()':
foo.cpp:12:2: error: reference to 'end' is ambiguous
end = n+1;
^
foo.cpp:6:16: note: candidates are: int end
int n, m, fir, end, a[100005], d[100005];
^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/string:51:0,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/random:40,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algo.h:66,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/algorithm:62,
from foo.cpp:2:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/range_access.h:97:5: note: template<class _Tp, unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
end(_Tp (&__arr)[_Nm])
^
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
end(const _Container& __cont) -> decltype(__cont.end())
^
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
end(_Container& __cont) -> decltype(__cont.end())
^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/utility:75:0,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/algorithm:60,
from foo.cpp:2:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
end(initializer_list<_Tp> __ils) noexcept
^
foo.cpp:15:17: error: reference to 'end' is ambiguous
if(i+a[i] >= end) {fir = i; break;}
^
foo.cpp:6:16: note: candidates are: int end
int n, m, fir, end, a[100005], d[100005];
^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/string:51:0,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/random:40,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algo.h:66,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/algorithm:62,
from foo.cpp:2:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/range_access.h:97:5: note: template<class _Tp, unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
end(_Tp (&__arr)[_Nm])
^
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
end(const _Container& __cont) -> decltype(__cont.end())
^
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
end(_Container& __cont) -> decltype(__cont.end())
^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/utility:75:0,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/algorithm:60,
from foo.cpp:2:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
end(initializer_list<_Tp> __ils) noexcept
^
foo.cpp:16:14: error: reference to 'end' is ambiguous
d[fir] = d[end] + 1;
^
foo.cpp:6:16: note: candidates are: int end
int n, m, fir, end, a[100005], d[100005];
^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/string:51:0,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/random:40,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algo.h:66,
from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/algorithm:62,
from foo.cpp:2:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/range_access.h:97:5: note: