/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:38:7: error: reference to 'next' is ambiguous
       next[i]=i+1;
       ^
foo.cpp:18:5: note: candidates are: int next [60000]
 int next[60000],befor[60000];
     ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:66:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/char_traits.h:39,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/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:56:11: error: reference to 'next' is ambiguous
        pa[next[1]]=1;
           ^
foo.cpp:18:5: note: candidates are: int next [60000]
 int next[60000],befor[60000];
     ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:66:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/char_traits.h:39,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/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:57:24: error: reference to 'next' is ambiguous
        linew[1]+=linew[next[1]];
                        ^
foo.cpp:18:5: note: candidates are: int next [60000]
 int next[60000],befor[60000];
     ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:66:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/char_traits.h:39,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/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:66:33: error: reference to 'next' is ambiguous
        if(linew[befor[p]]>linew[next[p]])
                                 ^
foo.cpp:18:5: note: candidates are: int next [60000]
 int next[60000],befor[60000];
     ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:66:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/char_traits.h:39,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/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:68:17: error: reference to 'next' is ambiguous
           pa[p]=next[p];
                 ^
foo.cpp:18:5: note: candidates are: int next [60000]
 int next[60000],befor[60000];
     ^
I

信息

递交者
类型
递交
题目
P1981 跳石头
语言
C++
递交时间
2015-11-10 19:01:33
评测时间
2015-11-10 19:01:35
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes