/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int rank(int, int)':
foo.cpp:99:27: error: reference to 'rank' is ambiguous
     if(size[l]>=k) return rank(l,k); else return rank(r,k-size[l]-1);
                           ^
foo.cpp:96:12: note: candidates are: int rank(int, int)
 inline int rank(int x,int k){
            ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\move.h:57:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_pair.h:59,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:64,
                 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:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:99:50: error: reference to 'rank' is ambiguous
     if(size[l]>=k) return rank(l,k); else return rank(r,k-size[l]-1);
                                                  ^
foo.cpp:96:12: note: candidates are: int rank(int, int)
 inline int rank(int x,int k){
            ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\move.h:57:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_pair.h:59,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:64,
                 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:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp: In function 'void split(int, int)':
foo.cpp:103:11: error: reference to 'rank' is ambiguous
     int x=rank(rt,pos); splay(x,rt);
           ^
foo.cpp:96:12: note: candidates are: int rank(int, int)
 inline int rank(int x,int k){
            ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\move.h:57:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_pair.h:59,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:64,
                 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:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:104:7: error: reference to 'rank' is ambiguous
     x=rank(rt,pos+num+1); splay(x,tr[rt][1]);
       ^
foo.cpp:96:12: note: candidates are: int rank(int, int)
 inline int rank(int x,int k){
            ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\move.h:57:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_pair.h:59,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:64,
                 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:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std

信息

递交者
类型
递交
题目
P1835 维护数列
语言
C++
递交时间
2016-12-13 10:02:42
评测时间
2016-12-13 10:02:43
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes