/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void addedge(int, int, int)':
foo.cpp:21:27: error: reference to 'next' is ambiguous
  num++;to[num]=y;c[num]=z;next[num]=head[x];head[x]=num;
                           ^
foo.cpp:14:33: note: candidates are: int next [400010]
 int head[maxn],to[maxm],c[maxm],next[maxm],q[maxn],d[maxn];
                                 ^
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++\algorithm:61,
                 from foo.cpp:6:
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:22:27: error: reference to 'next' is ambiguous
  num++;to[num]=x;c[num]=0;next[num]=head[y];head[y]=num;
                           ^
foo.cpp:14:33: note: candidates are: int next [400010]
 int head[maxn],to[maxm],c[maxm],next[maxm],q[maxn],d[maxn];
                                 ^
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++\algorithm:61,
                 from foo.cpp:6:
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 bfs()':
foo.cpp:48:26: error: reference to 'next' is ambiguous
   for (int p=head[x];p;p=next[p])
                          ^
foo.cpp:14:33: note: candidates are: int next [400010]
 int head[maxn],to[maxm],c[maxm],next[maxm],q[maxn],d[maxn];
                                 ^
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++\algorithm:61,
                 from foo.cpp:6:
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 'int find(int, int)':
foo.cpp:63:25: error: reference to 'next' is ambiguous
  for (int p=head[x];p;p=next[p])
                         ^
foo.cpp:14:33: note: candidates are: int next [400010]
 int head[maxn],to[maxm],c[maxm],next[maxm],q[maxn],d[maxn];
                                 ^
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++\algorithm:61,
                 from foo.cpp:6:
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
     ^

信息

递交者
类型
递交
题目
P1231 棋盘上的士兵
语言
C++
递交时间
2016-09-22 11:39:49
评测时间
2016-09-22 11:39:51
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes