/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:83:9: error: reference to 'next' is ambiguous
         next[i]=i+1;
         ^
foo.cpp:31:5: note: candidates are: int next [100101]
 int next[MAXN],bef[MAXN],pos[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++\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:88:5: error: reference to 'next' is ambiguous
     next[n]=-1; bef[1]=-1;
     ^
foo.cpp:31:5: note: candidates are: int next [100101]
 int next[MAXN],bef[MAXN],pos[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++\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:98:27: error: reference to 'next' is ambiguous
             if(p1!=-1) p1=next[p1]; 
                           ^
foo.cpp:31:5: note: candidates are: int next [100101]
 int next[MAXN],bef[MAXN],pos[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++\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:133:13: error: reference to 'next' is ambiguous
         bef[next[now]]=bef[now];
             ^
foo.cpp:31:5: note: candidates are: int next [100101]
 int next[MAXN],bef[MAXN],pos[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++\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:134:9: error: reference to 'next' is ambiguous
         next[bef[now]]=next[now];
         ^
foo.cpp:31:5: note: candidates are: int next [100101]
 int next[MAXN],bef[MAXN],pos[MAXN];
     ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,

信息

递交者
类型
递交
题目
P1780 开车旅行
语言
C++
递交时间
2016-10-05 19:15:41
评测时间
2016-10-05 19:15:42
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes