/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:34:31: error: reference to 'next' is ambiguous
     for(int i=0;i<topans;i++) next[i]=i+1;
                               ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                       ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:39:19: error: reference to 'next' is ambiguous
         while(ans[next[l]]>=ans[next[next[l]]])
                   ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                       ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:39:33: error: reference to 'next' is ambiguous
         while(ans[next[l]]>=ans[next[next[l]]])
                                 ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                       ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:39:38: error: reference to 'next' is ambiguous
         while(ans[next[l]]>=ans[next[next[l]]])
                                      ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                       ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:41:15: error: reference to 'next' is ambiguous
             l=next[l];//直到出现前比后小
               ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                       ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:42:9: error: reference to 'next' is ambiguous
         next[l]=next[next[l]];
         ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                       ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:42:17: error: reference to 'next' is ambiguous
         next[l]=next[next[l]];
                 ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                       ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:42:22: error: reference to 'next' is ambiguous
         next[l]=next[next[l]];
                      ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                       ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:45:17: error: reference to 'next' is ambiguous
     for(int i=0;next[i];i=next[i]) cout<<ans[next[i]];
                 ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                       ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:45:27: error: reference to 'next' is ambiguous
     for(int i=0;next[i];i=next[i]) cout<<ans[next[i]];
                           ^~~~
/in/foo.cc:7:39: note: candidates are: int next [5000010]
 int a[30005],ans[5000010],topa,topans,next[5000010];
                                      

信息

递交者
类型
递交
题目
P1545 集合删数
语言
C++
递交时间
2019-10-13 15:50:19
评测时间
2019-10-13 15:50:19
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes