Main.cc: In function ‘int main()’:
Main.cc:16:2: error: reference to ‘end’ is ambiguous
16 | end=2;
| ^~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/bits/range_access.h:110:37: note: candidates are: ‘template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)’
110 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:109:31: note: ‘template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)’
109 | template<typename _Tp> _Tp* end(valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:100:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])’
100 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/10/bits/range_access.h:81:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)’
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/10/bits/range_access.h:71:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)’
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/10/bits/range_access.h:36,
from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/initializer_list:101:5: note: ‘template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)’
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
Main.cc:7:45: note: ‘int end’
7 | int val[2001],n,m,cnt,maxn,s[2001],tmp,beg,end;
| ^~~
Main.cc:19:18: error: reference to ‘end’ is ambiguous
19 | { scanf("%d",&s[end]);
| ^~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/bits/range_access.h:110:37: note: candidates are: ‘template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)’
110 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:109:31: note: ‘template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)’
109 | template<typename _Tp> _Tp* end(valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:100:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])’
100 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/10/bits/range_access.h:81:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)’
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/10/bits/range_access.h:71:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)’
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/10/bits/range_access.h:36,
from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/initializer_list:101:5: note: ‘template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)’
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
Main.cc:7:45: note: ‘int end’
7 | int val[2001],n,m,cnt,maxn,s[2001],tmp,beg,end;
| ^~~
Main.cc:20:17: error: reference to ‘end’ is ambiguous
20 | for(int p=1;p<end;p++)
| ^~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/bits/range_access.h:110:37: note: candidates are: ‘template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)’
110 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:109:31: note: ‘template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)’
109 | template<typename _Tp> _Tp* end(valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:100:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])’
100 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/10/bits/range_access.h:81:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)’
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/10/bits/range_access.h:71:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)’
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/10/bits/range_access.h:36,
from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/initializer_list:101:5: note: ‘template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)’
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
Main.cc:7:45: note: ‘int end’
7 | int val[2001],n,m,cnt,maxn,s[2001],tmp,beg,end;
| ^~~
Main.cc:22:9: error: reference to ‘end’ is ambiguous
22 | if(s[end]==s[p]) beg=p+1;
| ^~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/bits/range_access.h:110:37: note: candidates are: ‘template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)’
110 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:109:31: note: ‘template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)’
109 | template<typename _Tp> _Tp* end(valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:100:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])’
100 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/10/bits/range_access.h:81:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)’
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/10/bits/range_access.h:71:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)’
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/10/bits/range_access.h:36,
from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/initializer_list:101:5: note: ‘template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)’
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
Main.cc:7:45: note: ‘int end’
7 | int val[2001],n,m,cnt,maxn,s[2001],tmp,beg,end;
| ^~~
Main.cc:24:6: error: reference to ‘end’ is ambiguous
24 | if(end-beg+1>maxn) maxn=end-beg+1;
| ^~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/bits/range_access.h:110:37: note: candidates are: ‘template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)’
110 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:109:31: note: ‘template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)’
109 | template<typename _Tp> _Tp* end(valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:100:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])’
100 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/10/bits/range_access.h:81:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)’
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/10/bits/range_access.h:71:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)’
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/10/bits/range_access.h:36,
from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/initializer_list:101:5: note: ‘template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)’
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
Main.cc:7:45: note: ‘int end’
7 | int val[2001],n,m,cnt,maxn,s[2001],tmp,beg,end;
| ^~~
Main.cc:24:27: error: reference to ‘end’ is ambiguous
24 | if(end-beg+1>maxn) maxn=end-beg+1;
| ^~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/bits/range_access.h:110:37: note: candidates are: ‘template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)’
110 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:109:31: note: ‘template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)’
109 | template<typename _Tp> _Tp* end(valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:100:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])’
100 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/10/bits/range_access.h:81:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)’
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/10/bits/range_access.h:71:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)’
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/10/bits/range_access.h:36,
from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/initializer_list:101:5: note: ‘template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)’
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
Main.cc:7:45: note: ‘int end’
7 | int val[2001],n,m,cnt,maxn,s[2001],tmp,beg,end;
| ^~~
Main.cc:25:3: error: reference to ‘end’ is ambiguous
25 | end++;
| ^~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/bits/range_access.h:110:37: note: candidates are: ‘template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)’
110 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:109:31: note: ‘template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)’
109 | template<typename _Tp> _Tp* end(valarray<_Tp>&);
| ^~~
/usr/include/c++/10/bits/range_access.h:100:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])’
100 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/10/bits/range_access.h:81:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)’
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/10/bits/range_access.h:71:5: note: ‘template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)’
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/10/bits/range_access.h:36,
from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from Main.cc:1:
/usr/include/c++/10/initializer_list:101:5: note: ‘template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)’
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
Main.cc:7:45: note: ‘int end’
7 | int val[2001],n,m,cnt,maxn,s[2001],tmp,beg,end;
| ^~~