/ Vijos /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:39:15: error: reference to 'hash' is ambiguous
   39 |             a=hash(a-1);//important
      |               ^~~~
In file included from /usr/include/c++/9/bits/basic_string.h:6722,
                 from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash'
   58 |     struct hash;
      |            ^~~~
foo.cc:8:5: note:                 'int hash(int)'
    8 | int hash(int x)//构建哈希表
      |     ^~~~
foo.cc:40:15: error: reference to 'hash' is ambiguous
   40 |             b=hash(b);//important
      |               ^~~~
In file included from /usr/include/c++/9/bits/basic_string.h:6722,
                 from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash'
   58 |     struct hash;
      |            ^~~~
foo.cc:8:5: note:                 'int hash(int)'
    8 | int hash(int x)//构建哈希表
      |     ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1112 小胖的奇偶
语言
C++
递交时间
2022-06-05 17:30:44
评测时间
2022-06-05 17:30:44
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes