/ Vijos /

记录详情

Compile Error

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:                

信息

递交者
类型
递交
题目
P1471 教主的游乐场
语言
C++
递交时间
2015-10-18 17:38:34
评测时间
2015-10-18 17:39:01
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes