/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int erfen(int, int, int)':
foo.cpp:21:8: error: reference to 'hash' is ambiguous
  if (x>hash[mid]) return erfen(x,mid+1,r);else return erfen(x,l,mid);  
        ^
foo.cpp:16:5: note: candidates are: int hash [100100]
 int hash[100100],temp[100100];
     ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:41,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^
foo.cpp: In function 'int main()':
foo.cpp:47:28: error: reference to 'hash' is ambiguous
    if (temp[i]!=temp[i-1]) hash[++c]=temp[i];
                            ^
foo.cpp:16:5: note: candidates are: int hash [100100]
 int hash[100100],temp[100100];
     ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:41,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^
foo.cpp: In function 'int erfen(int, int, int)':
foo.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
递交
题目
P1112 小胖的奇偶
语言
C++
递交时间
2016-08-30 14:29:12
评测时间
2016-08-30 14:29:13
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes