foo.cc: In function 'int main()':
foo.cc:40:5: error: reference to 'hash' is ambiguous
a = hash(a - 1);
^~~~
foo.cc:9:5: note: candidates are: int hash(int)
int hash(int x)
^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6587:0,
from /usr/include/c++/7/string:52,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from foo.cc:1:
/usr/include/c++/7/bits/functional_hash.h:58:12: note: template<class _Tp> struct std::hash
struct hash;
^~~~
foo.cc:41:5: error: reference to 'hash' is ambiguous
b = hash(b);
^~~~
foo.cc:9:5: note: candidates are: int hash(int)
int hash(int x)
^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6587:0,
from /usr/include/c++/7/string:52,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from foo.cc:1:
/usr/include/c++/7/bits/functional_hash.h:58:12: note: template<class _Tp> struct std::hash
struct hash;
^~~~
foo.cc:34:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &n, &k);
~~~~~^~~~~~~~~~~~~~~~
foo.cc:38:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%s", &a, &b, s);
~~~~~^~~~~~~~~~~~~~~~~~~~~