/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void add(int, int)':
/in/foo.cc:8:35: error: reference to 'next' is ambiguous
 void add(int x,int y){to[++cnt]=y;next[cnt]=head[x];head[x]=cnt;}
                                   ^~~~
/in/foo.cc:7:15: note: candidates are: int next [20004]
 int to[20004],next[20004],head[5003],cnt;
               ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/foo.cc:2:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc: In function 'void tarjan(int, int)':
/in/foo.cc:18:24: error: reference to 'next' is ambiguous
  for(int i=head[x];i;i=next[i])
                        ^~~~
/in/foo.cc:7:15: note: candidates are: int next [20004]
 int to[20004],next[20004],head[5003],cnt;
               ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/foo.cc:2:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc: In function 'int add1(int, int)':
/in/foo.cc:37:72: warning: no return statement in function returning non-void [-Wreturn-type]
 int add1(int x,int y){to1[++cnt1]=y;next1[cnt1]=head1[x];head1[x]=cnt1;}
                                                                        ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:59:25: error: reference to 'next' is ambiguous
   for(int j=head[i];j;j=next[j])
                         ^~~~
/in/foo.cc:7:15: note: candidates are: int next [20004]
 int to[20004],next[20004],head[5003],cnt;
               ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/foo.cc:2:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~

信息

递交者
类型
递交
题目
P1325 桐桐的糖果计划
语言
C++
递交时间
2017-10-26 20:26:12
评测时间
2017-10-26 20:26:12
评测机
分数
0
总耗时
372ms
峰值内存
36.117 MiB