/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void addedge(int, int)':
foo.cpp:16:2: error: reference to 'next' is ambiguous
  next[cnt]=first[a]; first[a]=cnt;
  ^
foo.cpp:8:16: note: candidates are: int next [200010]
 int to[200010],next[200010],first[10010];
                ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:66:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/deque:60,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/queue:60,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/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 spfa(int, int)':
foo.cpp:38:26: error: reference to 'next' is ambiguous
   for(int i=first[x];i;i=next[i])
                          ^
foo.cpp:8:16: note: candidates are: int next [200010]
 int to[200010],next[200010],first[10010];
                ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:66:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/deque:60,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/queue:60,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/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
     ^

信息

递交者
类型
递交
题目
P1909 寻找道路
语言
C++
递交时间
2015-11-03 21:14:16
评测时间
2015-11-03 21:14:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes