/ Vijos /

记录详情

Compile Error

foo.cc: In function 'void bfs()':
foo.cc:34:8: error: reference to 'hash' is ambiguous
   34 |     if(hash[pp])tail--;
      |        ^~~~
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:2:
/usr/include/c++/9/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash'
   58 |     struct hash;
      |            ^~~~
foo.cc:10:5: note:                 'int hash [1331000]'
   10 | int hash[M*M*M],num[N],bu[M][3][N],mon[M];
      |     ^~~~
foo.cc:35:10: error: reference to 'hash' is ambiguous
   35 |     else hash[pp]=1;
      |          ^~~~
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:2:
/usr/include/c++/9/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash'
   58 |     struct hash;
      |            ^~~~
foo.cc:10:5: note:                 'int hash [1331000]'
   10 | int hash[M*M*M],num[N],bu[M][3][N],mon[M];
      |     ^~~~
foo.cc: In function 'int main()':
foo.cc:50:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   50 |  scanf("%d%d",&n,&m);
      |  ~~~~~^~~~~~~~~~~~~~
foo.cc:54:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   54 |   scanf("%d",&mon[i]);
      |   ~~~~~^~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1019 补丁VS错误
语言
C++
递交时间
2022-04-16 13:14:06
评测时间
2022-04-16 13:14:06
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes