/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void push(int, int)':
foo.cpp:10:9: error: reference to 'next' is ambiguous
         next[top] = head[i];
         ^
foo.cpp:5:19: note: candidates are: int next [10000001]
 int to[10000001], next[10000001], head[10000001], top = 0;
                   ^
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++\bits\char_traits.h:39,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\istream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\sstream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\complex:45,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ccomplex:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32\bits\stdc++.h:52,
                 from foo.cpp:1:
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: In function 'int main()':
foo.cpp:27:46: error: reference to 'next' is ambiguous
                 for (int j = head[i]; j; j = next[j])
                                              ^
foo.cpp:5:19: note: candidates are: int next [10000001]
 int to[10000001], next[10000001], head[10000001], top = 0;
                   ^
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++\bits\char_traits.h:39,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\istream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\sstream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\complex:45,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ccomplex:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32\bits\stdc++.h:52,
                 from foo.cpp:1:
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
     ^

信息

递交者
类型
递交
题目
P1634 生产武器
语言
C++
递交时间
2016-08-15 21:18:59
评测时间
2016-08-15 21:19:00
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes