/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:37:19: error: reference to 'hash' is ambiguous
    if(a[j]==1)    hash[j]++;
                   ^~~~
/in/foo.cc:7:5: note: candidates are: int hash [10001]
 int hash[10001];
     ^~~~
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:41:2: error: reference to 'hash' is ambiguous
  hash[0]=n;
  ^~~~
/in/foo.cc:7:5: note: candidates are: int hash [10001]
 int hash[10001];
     ^~~~
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:44:6: error: reference to 'hash' is ambiguous
   if(hash[i]==n)
      ^~~~
/in/foo.cc:7:5: note: candidates are: int hash [10001]
 int hash[10001];
     ^~~~
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:14:14: warning: unused variable 'p' [-Wunused-variable]
  int i,j,k,n,p;
              ^

信息

递交者
类型
递交
题目
P1059 积木城堡
语言
C++
递交时间
2017-07-01 15:15:16
评测时间
2017-07-01 15:15:16
评测机
分数
0
总耗时
231ms
峰值内存
27.742 MiB