Compile Error

foo.cc: In function 'int main()':
foo.cc:27:7: error: reference to 'hash' is ambiguous
    if(hash[j]==0){
       ^~~~
foo.cc:4:5: note: candidates are: int hash [5000001]
 int hash[5000001]; 
     ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6587:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from foo.cc:1:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
foo.cc:29:5: error: reference to 'hash' is ambiguous
     hash[j]=1;
     ^~~~
foo.cc:4:5: note: candidates are: int hash [5000001]
 int hash[5000001]; 
     ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6587:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from foo.cc:1:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
foo.cc:35:8: error: reference to 'hash' is ambiguous
     if(hash[k]==0){
        ^~~~
foo.cc:4:5: note: candidates are: int hash [5000001]
 int hash[5000001]; 
     ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6587:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from foo.cc:1:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
foo.cc:36:6: error: reference to 'hash' is ambiguous
      hash[k]=1;
      ^~~~
foo.cc:4:5: note: candidates are: int hash [5000001]
 int hash[5000001]; 
     ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6587:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from foo.cc:1:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
「一本通 1.1 例 5」智力大冲浪
语言
C++
递交时间
2021-08-22 20:34:28
评测时间
2021-08-22 20:34:28
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes