/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void add(int, int)':
/in/foo.cc:7:14: error: reference to 'next' is ambiguous
  to[++tot]=y,next[tot]=first[x],first[x]=tot;
              ^~~~
/in/foo.cc:5:17: note: candidates are: int next [2005]
 int first[MAXN],next[MAXN],to[MAXN];
                 ^~~~
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/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/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 DFS(int, int)':
/in/foo.cc:11:26: error: reference to 'next' is ambiguous
  for (int i=first[x];i;i=next[i]){
                          ^~~~
/in/foo.cc:5:17: note: candidates are: int next [2005]
 int first[MAXN],next[MAXN],to[MAXN];
                 ^~~~
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/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/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
     ^~~~

信息

递交者
类型
递交
题目
P1688 病毒传递
语言
C++
递交时间
2018-11-16 19:36:41
评测时间
2018-11-16 19:36:41
评测机
分数
0
总耗时
1203ms
峰值内存
134.016 MiB