/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void insert(int, int, int, int)':
foo.cpp:17:18: error: reference to 'rank' is ambiguous
  if(!p[now].next[rank[ch[num][pos]]])p[now].next[rank[ch[num][pos]]]=++top;
                  ^
foo.cpp:5:7: note: candidates are: int rank [27]
 int n,rank[27],top=1,i;
       ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/move.h:57:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_pair.h:59,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:64,
                 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++/type_traits:1340:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:17:50: error: reference to 'rank' is ambiguous
  if(!p[now].next[rank[ch[num][pos]]])p[now].next[rank[ch[num][pos]]]=++top;
                                                  ^
foo.cpp:5:7: note: candidates are: int rank [27]
 int n,rank[27],top=1,i;
       ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/move.h:57:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_pair.h:59,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:64,
                 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++/type_traits:1340:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:18:35: error: reference to 'rank' is ambiguous
  insert(num,pos+1,len,p[now].next[rank[ch[num][pos]]]);
                                   ^
foo.cpp:5:7: note: candidates are: int rank [27]
 int n,rank[27],top=1,i;
       ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/move.h:57:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_pair.h:59,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:64,
                 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++/type_traits:1340:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp: In function 'int main()':
foo.cpp:35:3: error: reference to 'rank' is ambiguous
   rank[tmp-'a']=i;
   ^
foo.cpp:5:7: note: candidates are: int rank [27]
 int n,rank[27],top=1,i;
       ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/move.h:57:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_pair.h:59,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:64,
                 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

信息

递交者
类型
递交
题目
P1500 笨笨的单词排序
语言
C++
递交时间
2015-10-12 17:07:16
评测时间
2015-10-12 17:07:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes