/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:66:47: error: reference to 'end' is ambiguous
     for (i = 1;i <= n;i++) if (In(t,sqr[i])) {end = i;break;}
                                               ^
foo.cpp:46:11: note: candidates are: int end
 int start,end;
           ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\string:51:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\random:41,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:1:
c:\tdm-gcc-32\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:\tdm-gcc-32\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:\tdm-gcc-32\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())
     ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\utility:74:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:60,
                 from foo.cpp:1:
c:\tdm-gcc-32\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
     ^
foo.cpp:67:18: error: reference to 'end' is ambiguous
     if (start == end)
                  ^
foo.cpp:46:11: note: candidates are: int end
 int start,end;
           ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\string:51:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\random:41,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:1:
c:\tdm-gcc-32\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:\tdm-gcc-32\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:\tdm-gcc-32\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())
     ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\utility:74:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:60,
                 from foo.cpp:1:
c:\tdm-gcc-32\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
     ^
foo.cpp:71:28: error: reference to 'end' is ambiguous
         for (i = start;i < end;i++)
                            ^
foo.cpp:46:11: note: candidates are: int end
 int start,end;
           ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\string:51:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\random:41,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:1:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\range_access.h:97:5: note:     

信息

递交者
类型
递交
题目
P1804 智能车比赛
语言
C++
递交时间
2015-05-03 23:42:21
评测时间
2015-05-03 23:43:24
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes