QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#89371#5821. 交换机mydCompile Error//C++171.1kb2023-03-19 21:36:392023-03-19 21:36:42

详细

answer.code: In function ‘int main()’:
answer.code:33:37: error: reference to ‘hash’ is ambiguous
   33 |                 hs[i + n] = hs[i] = hash(str);
      |                                     ^~~~
In file included from /usr/include/c++/11/functional:56,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from answer.code:3:
/usr/include/c++/11/bits/functional_hash.h:59:12: note: candidates are: ‘template<class _Tp> struct std::hash’
   59 |     struct hash;
      |            ^~~~
answer.code:21:5: note:                 ‘int hash(char*)’
   21 | int hash(char *s) {
      |     ^~~~
answer.code:30:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   30 |         scanf("%d %d", &n, &k);
      |         ~~~~~^~~~~~~~~~~~~~~~~
answer.code:32:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   32 |                 scanf("%s %d:%d", str, &a, &b);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~