/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:17:16: error: reference to 'next' is ambiguous
         memset(next,-1,sizeof(next));
                ^
foo.cpp:6:5: note: candidates are: int next [3005]
 int next[3005],a[10005],b[10005],m,i,n;
     ^
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++/algorithm:61,
                 from foo.cpp:4:
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:17:31: error: reference to 'next' is ambiguous
         memset(next,-1,sizeof(next));
                               ^
foo.cpp:6:5: note: candidates are: int next [3005]
 int next[3005],a[10005],b[10005],m,i,n;
     ^
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++/algorithm:61,
                 from foo.cpp:4:
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:21:18: error: reference to 'next' is ambiguous
             if ((next[a[j]]!=-1)&&(next[a[j]]!=a[j+1])){
                  ^
foo.cpp:6:5: note: candidates are: int next [3005]
 int next[3005],a[10005],b[10005],m,i,n;
     ^
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++/algorithm:61,
                 from foo.cpp:4:
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:21:36: error: reference to 'next' is ambiguous
             if ((next[a[j]]!=-1)&&(next[a[j]]!=a[j+1])){
                                    ^
foo.cpp:6:5: note: candidates are: int next [3005]
 int next[3005],a[10005],b[10005],m,i,n;
     ^
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++/algorithm:61,
                 from foo.cpp:4:
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:25:13: error: reference to 'next' is ambiguous
             next[a[j]]=a[j+1];
             ^
foo.cpp:6:5: note: candidates are: int next [3005]
 int next[3005],a[10005],b[10005],m,i,n;
     ^
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++/algorithm:61,
                 from foo.cpp:4:
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:27:26: error: reference to 'next' is ambiguous
         int t=a[m],nextt=next[a[m]],ans=0;
                          ^
foo.cpp:6:5: note: candidates are: int next [3005]
 int next[3005],a[10005],b[10005],m,i,n;
     ^
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/g

信息

递交者
类型
递交
题目
P1965 夜夜的数据加强
比赛
夜夜的模拟赛之十三岁的梦想
语言
C++
递交时间
2015-10-03 20:18:57
评测时间
2015-10-03 22:16:57
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes