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)提供评测服务