/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void add(int, int)':
foo.cpp:38:5: error: reference to 'next' is ambiguous
     next[tot]=begin[a];
     ^
foo.cpp:32:16: note: candidates are: int next [10000]
 int begin[NUM],next[NUM],t[NUM],tot;
                ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:61,
                 from foo.cpp:4:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_iterator_base_funcs.h:184:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^
foo.cpp:38:15: error: reference to 'begin' is ambiguous
     next[tot]=begin[a];
               ^
foo.cpp:32:5: note: candidates are: int begin [10000]
 int begin[NUM],next[NUM],t[NUM],tot;
     ^
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++\random:41,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:4:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\range_access.h:87:5: note:                 template<class _Tp, unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])
     begin(_Tp (&__arr)[_Nm])
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\range_access.h:58:5: note:                 template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
     begin(const _Container& __cont) -> decltype(__cont.begin())
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\range_access.h:48:5: note:                 template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
     begin(_Container& __cont) -> decltype(__cont.begin())
     ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\utility:74:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:60,
                 from foo.cpp:4:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\initializer_list:89:5: note:                 template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)
     begin(initializer_list<_Tp> __ils) noexcept
     ^
foo.cpp:39:5: error: reference to 'begin' is ambiguous
     begin[a]=tot;
     ^
foo.cpp:32:5: note: candidates are: int begin [10000]
 int begin[NUM],next[NUM],t[NUM],tot;
     ^
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++\random:41,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:4:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\range_access.h:87:5: note:                 template<class _Tp, unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])
     begin(_Tp (&__arr)[_Nm])
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\range_access.h:58:5: note:                 template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
     begin(const _Container& __cont) -> decltype(__cont.begin())
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\range_access.h:48:5: note:                 template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
     begin(_Container& __cont) -> decltype(__cont.begin())
     ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\utility:74:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:60,
                 from foo.cpp:4:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\initializer_list:89:5: note:                 template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)
     begin(initializer_list<_Tp> __ils) noexcept
     ^
foo.cpp: In function 'int dfs(int)':
foo.cp

信息

递交者
类型
递交
题目
P1718 兔兔和蛋蛋
语言
C++
递交时间
2016-12-14 20:47:38
评测时间
2016-12-14 20:47:54
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes