/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void link(int, int)':
foo.cpp:26:13: error: reference to 'next' is ambiguous
  to[++tt]=y;next[tt]=head[x];head[x]=tt;
             ^
foo.cpp:13:16: note: candidates are: int next [100010]
 int head[maxn],next[maxn],to[maxn],tt;
                ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_iterator_base_funcs.h:184:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^
foo.cpp: In function 'bool dfs(int)':
foo.cpp:30:26: error: reference to 'next' is ambiguous
  for(int i=head[u],v;i;i=next[i])
                          ^
foo.cpp:13:16: note: candidates are: int next [100010]
 int head[maxn],next[maxn],to[maxn],tt;
                ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_iterator_base_funcs.h:184:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^

信息

递交者
类型
递交
题目
P1820 变换序列
语言
C++
递交时间
2016-09-23 15:53:44
评测时间
2016-09-23 15:53:45
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes