/ WHOJ /

记录详情

Compile Error

foo.cc: In function 'void add(int, int)':
foo.cc:16:15: error: reference to 'next' is ambiguous
   16 |  ver[++cut]=y;next[cut]=head[x];head[x]=cut;
      |               ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
  213 |     next(_InputIterator __x, typename
      |     ^~~~
foo.cc:10:26: note:                 'int next [200020]'
   10 | int cut,head[N],ver[2*N],next[2*N];
      |                          ^~~~
foo.cc: In function 'void dfs1(int, int)':
foo.cc:24:24: error: reference to 'next' is ambiguous
   24 |  for(int i=head[x];i;i=next[i]){
      |                        ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
  213 |     next(_InputIterator __x, typename
      |     ^~~~
foo.cc:10:26: note:                 'int next [200020]'
   10 | int cut,head[N],ver[2*N],next[2*N];
      |                          ^~~~
foo.cc: In function 'void dfs2(int, int)':
foo.cc:36:24: error: reference to 'next' is ambiguous
   36 |  for(int i=head[x];i;i=next[i]){
      |                        ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
  213 |     next(_InputIterator __x, typename
      |     ^~~~
foo.cc:10:26: note:                 'int next [200020]'
   10 | int cut,head[N],ver[2*N],next[2*N];
      |                          ^~~~
foo.cc: In function 'void dfs_k(int, int)':
foo.cc:47:24: error: reference to 'next' is ambiguous
   47 |  for(int i=head[x];i;i=next[i]){
      |                        ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
  213 |     next(_InputIterator __x, typename
      |     ^~~~
foo.cc:10:26: note:                 'int next [200020]'
   10 | int cut,head[N],ver[2*N],next[2*N];
      |                          ^~~~
foo.cc: In function 'int main()':
foo.cc:56:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   56 |     scanf("%d%d",&n,&k);
      |     ~~~~~^~~~~~~~~~~~~~
foo.cc:59:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   59 |      scanf("%d%d",&x,&y);
      |      ~~~~~^~~~~~~~~~~~~~
Found 20 testcases.
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1420 【XR-3】核心城市
题目数据
下载
语言
C++
递交时间
2022-07-28 21:54:38
评测时间
2022-07-28 21:54:38
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes