/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void adde(int, int, int)':
foo.cpp:22:18: error: reference to 'next' is ambiguous
  cnt++,to[cnt]=t,next[cnt]=head[f],head[f]=cnt,w[cnt]=ww;
                  ^
foo.cpp:19:28: note: candidates are: int next [600020]
 int head[MAXN],to[MAXN<<1],next[MAXN<<1],w[MAXN<<1],cnt=1;
                            ^
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++/bits/char_traits.h:39,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 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:23:18: error: reference to 'next' is ambiguous
  cnt++,to[cnt]=f,next[cnt]=head[t],head[t]=cnt,w[cnt]=ww;
                  ^
foo.cpp:19:28: note: candidates are: int next [600020]
 int head[MAXN],to[MAXN<<1],next[MAXN<<1],w[MAXN<<1],cnt=1;
                            ^
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++/bits/char_traits.h:39,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 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 'void BFS(int)':
foo.cpp:33:25: error: reference to 'next' is ambiguous
   for(int i=head[x];i;i=next[i])
                         ^
foo.cpp:19:28: note: candidates are: int next [600020]
 int head[MAXN],to[MAXN<<1],next[MAXN<<1],w[MAXN<<1],cnt=1;
                            ^
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++/bits/char_traits.h:39,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 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 'void bfs(int)':
foo.cpp:92:25: error: reference to 'next' is ambiguous
   for(int i=head[x];i;i=next[i])
                         ^
foo.cpp:19:28: note: candidates are: int next [600020]
 int head[MAXN],to[MAXN<<1],next[MAXN<<1],w[MAXN<<1],cnt=1;
                            ^
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++/bits/char_traits.h:39,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 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:             

信息

递交者
类型
递交
题目
P1983 运输计划
语言
C++
递交时间
2015-11-09 18:26:35
评测时间
2015-11-09 18:26:36
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes