/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void link(int, int)':
/in/foo.cc:15:2: error: reference to 'next' is ambiguous
  next[++ecnt]=first[x];
  ^~~~
/in/foo.cc:6:26: note: candidates are: int next [600011]
 int n,m,ecnt,first[MAXN],next[MAXM],to[MAXM],f[MAXN][20],deep[MAXN],ans[MAXN],val[MAXN],tong[MAXN],MAXD,w[MAXN],num[1000011];
                          ^~~~
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/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 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: In function 'void init(int, int)':
/in/foo.cc:43:27: error: reference to 'next' is ambiguous
  for(int i=first[x]; i; i=next[i])
                           ^~~~
/in/foo.cc:6:26: note: candidates are: int next [600011]
 int n,m,ecnt,first[MAXN],next[MAXM],to[MAXM],f[MAXN][20],deep[MAXN],ans[MAXN],val[MAXN],tong[MAXN],MAXD,w[MAXN],num[1000011];
                          ^~~~
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/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 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: In function 'void dfs(int, int)':
/in/foo.cc:74:27: error: reference to 'next' is ambiguous
  for(int i=first[x]; i; i=next[i])
                           ^~~~
/in/foo.cc:6:26: note: candidates are: int next [600011]
 int n,m,ecnt,first[MAXN],next[MAXM],to[MAXM],f[MAXN][20],deep[MAXN],ans[MAXN],val[MAXN],tong[MAXN],MAXD,w[MAXN],num[1000011];
                          ^~~~
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/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 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: In function 'void DFS(int, int)':
/in/foo.cc:91:27: error: reference to 'next' is ambiguous
  for(int i=first[x]; i; i=next[i])
                           ^~~~
/in/foo.cc:6:26: note: candidates are: int next [600011]
 int n,m,ecnt,first[MAXN],next[MAXM],to[MAXM],f[MAXN][20],deep[MAXN],ans[MAXN],val[MAXN],tong[MAXN],MAXD,w[MAXN],num[1000011];
                          ^~~~
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/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 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
     ^~~~

信息

递交者
类型
递交
题目
P2004 天天爱跑步
语言
C++
递交时间
2017-07-14 16:52:10
评测时间
2017-07-14 16:52:10
评测机
分数
0
总耗时
976ms
峰值内存
126.477 MiB