foo.cpp: In function 'void work()':
foo.cpp:44:5: error: reference to 'end' is ambiguous
end=(1<<m)-1;
^
foo.cpp:18:13: note: candidates are: int end
int n,m,ans,end;
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:42:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:52,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\locale_classes.h:40,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\ios_base.h:41,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:42,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\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
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:51:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\locale_classes.h:40,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\ios_base.h:41,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:42,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\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:\mingw\lib\gcc\mingw32\4.8.1\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:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
end(_Container& __cont) -> decltype(__cont.end())
^
foo.cpp:46:17: error: reference to 'end' is ambiguous
for(int s=0;s<=end;s++) {
^
foo.cpp:18:13: note: candidates are: int end
int n,m,ans,end;
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:42:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:52,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\locale_classes.h:40,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\ios_base.h:41,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:42,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\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
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:51:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\locale_classes.h:40,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\ios_base.h:41,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:42,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\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:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\range_access.h:78:5: note: template<class _Container> decltype (__cont.en