/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void work()':
foo.cpp:109:3: error: reference to 'rank' is ambiguous
   rank[i]=i;
   ^
foo.cpp:75:35: note: candidates are: int rank [100100]
 int n,x0,m,s,x,h[N],pre[N],nxt[N],rank[N];
                                   ^
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++\utility:70,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:60,
                 from foo.cpp:5:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:111:7: error: reference to 'rank' is ambiguous
  sort(rank+1,rank+1+n,icmp);
       ^
foo.cpp:75:35: note: candidates are: int rank [100100]
 int n,x0,m,s,x,h[N],pre[N],nxt[N],rank[N];
                                   ^
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++\utility:70,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:60,
                 from foo.cpp:5:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:111:14: error: reference to 'rank' is ambiguous
  sort(rank+1,rank+1+n,icmp);
              ^
foo.cpp:75:35: note: candidates are: int rank [100100]
 int n,x0,m,s,x,h[N],pre[N],nxt[N],rank[N];
                                   ^
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++\utility:70,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:60,
                 from foo.cpp:5:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:112:2: error: reference to 'rank' is ambiguous
  rank[0]=rank[n+1]=0;h[0]=inf;
  ^
foo.cpp:75:35: note: candidates are: int rank [100100]
 int n,x0,m,s,x,h[N],pre[N],nxt[N],rank[N];
                                   ^
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++\utility:70,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:60,
                 from foo.cpp:5:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:112:10: error: reference to 'rank' is ambiguous
  rank[0]=rank[n+1]=0;h[0]=inf;
          ^
foo.cpp:75:35: note: candidates are: int rank [100100]
 int n,x0,m,s,x,h[N],pre[N],nxt[N],rank[N];
                                   ^
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++\utility:70,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:60,
                 from foo.cpp:5:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\type_traits:1243:12: note:                 template<class> struct std::rank
     struct rank
            ^
foo.cpp:114:7: error: reference to 'rank' is ambiguous
   pre[rank[i]]=rank[i-1];
       ^
foo.cpp:75:35: note: candidates are: int rank [100100]
 int n,x0,m,s,x,h[N],pre[N],nxt[N],rank[N];
                                   ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\move.h:57:

信息

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