Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:29:7: error: reference to 'hash' is ambiguous
   if(!hash[a[i].times])
       ^~~~
/in/foo.cc:16:17: note: candidates are: int hash [510]
 int n,total,ans,hash[maxn];
                 ^~~~
In file included from /usr/include/c++/6/bits/basic_string.h:5643:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:30:3: error: reference to 'hash' is ambiguous
   hash[a[i].times]=1;
   ^~~~
/in/foo.cc:16:17: note: candidates are: int hash [510]
 int n,total,ans,hash[maxn];
                 ^~~~
In file included from /usr/include/c++/6/bits/basic_string.h:5643:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:33:8: error: reference to 'hash' is ambiguous
    if(!hash[j])
        ^~~~
/in/foo.cc:16:17: note: candidates are: int hash [510]
 int n,total,ans,hash[maxn];
                 ^~~~
In file included from /usr/include/c++/6/bits/basic_string.h:5643:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:35:5: error: reference to 'hash' is ambiguous
     hash[j]=1;
     ^~~~
/in/foo.cc:16:17: note: candidates are: int hash [510]
 int n,total,ans,hash[maxn];
                 ^~~~
In file included from /usr/include/c++/6/bits/basic_string.h:5643:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~

信息

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