foo.cc: In function 'int main()':
foo.cc:47:17: error: reference to 'hash' is ambiguous
47 | 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:16:5: note: 'int hash(int)'
16 | int hash(int x)//构建哈希表
| ^~~~
foo.cc:48:17: error: reference to 'hash' is ambiguous
48 | 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:16:5: note: 'int hash(int)'
16 | int hash(int x)//构建哈希表
| ^~~~
[Hydro](https://hydro.ac)提供评测服务