/ Vijos /

记录详情

Compile Error

foo.cc: In function 'void addedge(int, int)':
foo.cc:22:20: error: expected primary-expression before '(' token
     edge[++l]=edges(y,next[x]);next[x]=l;
                    ^
foo.cc:22:23: error: reference to 'next' is ambiguous
     edge[++l]=edges(y,next[x]);next[x]=l;
                       ^~~~
foo.cc:20:5: note: candidates are: int next [101000]
 int next[maxn],l;
     ^~~~
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 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
     ^~~~
foo.cc:22:32: error: reference to 'next' is ambiguous
     edge[++l]=edges(y,next[x]);next[x]=l;
                                ^~~~
foo.cc:20:5: note: candidates are: int next [101000]
 int next[maxn],l;
     ^~~~
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 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
     ^~~~
foo.cc:23:20: error: expected primary-expression before '(' token
     edge[++l]=edges(x,next[y]);next[y]=l;
                    ^
foo.cc:23:23: error: reference to 'next' is ambiguous
     edge[++l]=edges(x,next[y]);next[y]=l;
                       ^~~~
foo.cc:20:5: note: candidates are: int next [101000]
 int next[maxn],l;
     ^~~~
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 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
     ^~~~
foo.cc:23:32: error: reference to 'next' is ambiguous
     edge[++l]=edges(x,next[y]);next[y]=l;
                                ^~~~
foo.cc:20:5: note: candidates are: int next [101000]
 int next[maxn],l;
     ^~~~
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 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
     ^~~~
foo.cc: In function 'void bfs()':
foo.cc:29:20: error: reference to 'next' is ambiguous
         for (int i=next[u];i;i=edge[i].next)
                    ^~~~
foo.cc:20:5: note: candidates are: int next [101000]
 int next[maxn],l;
     ^~~~
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 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
     ^~~~
foo.cc: In function 'dd ch(double)':
foo.cc:55:24: error: reference to 'next' is ambiguous
             for (int i=next[u];i;i=edge[i].next)
                        ^~~~
foo.cc:20:5: note: candidates are: int next [101000]
 int next[maxn],l;
     ^~~~
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 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
     ^~~~
foo.cc:56:20: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
                 if (fa[u]!=edge[i].to)
                    ^
foo.cc:63:24: error: reference to 'next' is ambiguous
             for (int i=next[u];i;i=edge[i].next) {
                        ^~~~
foo.cc:20:5: note: candidates are: int next [101000]
 int next[maxn],l;
     ^~~~
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 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
     ^~~~
foo.cc: In function 'int main()':
foo.cc:120:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~
foo.cc:125:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",&u,&v);
         ~~~~~^~~~~~~~~~~~~~
foo.cc:131:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lf",&p);
     ~~~~~^~~~~~~~~~

自豪的采用 HydroJudge 进行评测(github.com/hydro-dev/HydroJudge)
正在同步测试数据,请稍后

信息

递交者
类型
递交
题目
P1962 嫁接树
语言
C++
递交时间
2020-07-08 21:24:01
评测时间
2020-07-08 21:24:01
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes