/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void init(int)':
foo.cpp:9:9: error: reference to 'rank' is ambiguous
         rank[i]=0;
         ^
foo.cpp:4:15: note: candidates are: int rank [5005]
 int par[5005],rank[5005];
               ^
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:1:
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 unite(int, int)':
foo.cpp:22:8: error: reference to 'rank' is ambiguous
     if(rank[a]<rank[b]) par[a]=b;
        ^
foo.cpp:4:15: note: candidates are: int rank [5005]
 int par[5005],rank[5005];
               ^
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:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:22:16: error: reference to 'rank' is ambiguous
     if(rank[a]<rank[b]) par[a]=b;
                ^
foo.cpp:4:15: note: candidates are: int rank [5005]
 int par[5005],rank[5005];
               ^
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:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:25:12: error: reference to 'rank' is ambiguous
         if(rank[a]==rank[b]) rank[a]++;
            ^
foo.cpp:4:15: note: candidates are: int rank [5005]
 int par[5005],rank[5005];
               ^
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:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:25:21: error: reference to 'rank' is ambiguous
         if(rank[a]==rank[b]) rank[a]++;
                     ^
foo.cpp:4:1

信息

递交者
类型
递交
题目
P1034 家族
语言
C++
递交时间
2016-11-23 15:26:07
评测时间
2016-11-23 15:26:08
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes