/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void SAP(long int)':
foo.cpp:28:33: error: reference to 'next' is ambiguous
        for(i=first[pos];i!=-1;i=next[i])
                                 ^
foo.cpp:11:45: note: candidates are: long int next [320000]
    long u[maxm]={0},v[maxm]={0},w[maxm]={0},next[maxm]={0};
                                             ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:
c:\tdm-gcc-32\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:18:14: warning: unused variable 'j' [-Wunused-variable]
       long i,j,temp;
              ^
foo.cpp: In function 'int main()':
foo.cpp:75:13: error: reference to 'next' is ambiguous
             next[tot]=first[u[tot]];
             ^
foo.cpp:11:45: note: candidates are: long int next [320000]
    long u[maxm]={0},v[maxm]={0},w[maxm]={0},next[maxm]={0};
                                             ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:
c:\tdm-gcc-32\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:81:13: error: reference to 'next' is ambiguous
             next[tot]=first[u[tot]];
             ^
foo.cpp:11:45: note: candidates are: long int next [320000]
    long u[maxm]={0},v[maxm]={0},w[maxm]={0},next[maxm]={0};
                                             ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:
c:\tdm-gcc-32\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:92:13: error: reference to 'next' is ambiguous
             next[tot]=first[u[tot]];
             ^
foo.cpp:11:45: note: candidates are: long int next [320000]
    long u[maxm]={0},v[maxm]={0},w[maxm]={0},next[maxm]={0};
                                             ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:

信息

递交者
类型
递交
题目
P1352 最大获利
语言
C++
递交时间
2015-04-29 22:58:54
评测时间
2015-04-29 22:59:20
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes