/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:16:3: error: reference to 'hash' is ambiguous
   hash[s[i]]++;
   ^~~~
/in/foo.cc:8:5: note: candidates are: int hash [27]
 int hash[27];
     ^~~~
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:3:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:19:6: error: reference to 'hash' is ambiguous
   if(hash[i]!=0 && hash[i]>maxn) maxn=hash[i];
      ^~~~
/in/foo.cc:8:5: note: candidates are: int hash [27]
 int hash[27];
     ^~~~
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:3:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:19:20: error: reference to 'hash' is ambiguous
   if(hash[i]!=0 && hash[i]>maxn) maxn=hash[i];
                    ^~~~
/in/foo.cc:8:5: note: candidates are: int hash [27]
 int hash[27];
     ^~~~
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:3:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:19:39: error: reference to 'hash' is ambiguous
   if(hash[i]!=0 && hash[i]>maxn) maxn=hash[i];
                                       ^~~~
/in/foo.cc:8:5: note: candidates are: int hash [27]
 int hash[27];
     ^~~~
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:3:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:20:6: error: reference to 'hash' is ambiguous
   if(hash[i]!=0 && hash[i]<minn) minn=hash[i];
      ^~~~
/in/foo.cc:8:5: note: candidates are: int hash [27]
 int hash[27];
     ^~~~
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:3:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:20:20: error: reference to 'hash' is ambiguous
   if(hash[i]!=0 && hash[i]<minn) minn=hash[i];
                    ^~~~
/in/foo.cc:8:5: note: candidates are: int hash [27]
 int hash[27];
     ^~~~
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:3:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:20:39: error: reference to 'hash' is ambiguous
   if(hash[i]!=0 && hash[i]<minn) minn=hash[i];
                                       ^~~~
/in/foo.cc:8:5: note: candidates are: int hash [27]
 int hash[27];
     ^~~~
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:3:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:30:2: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
  else
  ^~~~
/in/foo.cc:32:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
     return 0;
     ^~~~~~

信息

递交者
类型
递交
题目
P1495 笨小猴
语言
C++
递交时间
2017-11-05 19:02:57
评测时间
2017-11-05 19:02:57
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes