/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int find(int)':
foo.cpp:16:7: error: reference to 'hash' is ambiguous
   if (hash[M]<val)L=M+1;
       ^
foo.cpp:9:5: note: candidates are: int hash [20005]
 int hash[MAXN],tot;
     ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\random:41,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:2:
c:\tdm-gcc-32\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:44:2: error: reference to 'hash' is ambiguous
  hash[tot=1]=st[1];
  ^
foo.cpp:9:5: note: candidates are: int hash [20005]
 int hash[MAXN],tot;
     ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\random:41,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:2:
c:\tdm-gcc-32\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:46:13: error: reference to 'hash' is ambiguous
  if (st[i]!=hash[tot])
             ^
foo.cpp:9:5: note: candidates are: int hash [20005]
 int hash[MAXN],tot;
     ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\random:41,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:2:
c:\tdm-gcc-32\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:47:2: error: reference to 'hash' is ambiguous
  hash[++tot]=st[i];
  ^
foo.cpp:9:5: note: candidates are: int hash [20005]
 int hash[MAXN],tot;
     ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\random:41,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:2:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^

信息

递交者
类型
递交
题目
P1112 小胖的奇偶
语言
C++
递交时间
2015-07-07 20:38:38
评测时间
2015-07-07 20:38:39
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes