/ WHOJ /

记录详情

Compile Error

foo.cc: In function 'bool count(int)':
foo.cc:23:34: error: reference to 'hash' is ambiguous
   23 |     for (register int j = 0; j < hash[i].size(); ++j)
      |                                  ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_bvector.h:61,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/vector:68,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/queue:61,
                 from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
foo.cc:19:12: note:                 'std::vector<int> hash [999987]'
   19 | vector<int>hash[mod];
      |            ^~~~
foo.cc:24:13: error: reference to 'hash' is ambiguous
   24 |         if (hash[i][j] == x)
      |             ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_bvector.h:61,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/vector:68,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/queue:61,
                 from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
foo.cc:19:12: note:                 'std::vector<int> hash [999987]'
   19 | vector<int>hash[mod];
      |            ^~~~
foo.cc: In function 'void erase(int)':
foo.cc:33:17: error: reference to 'hash' is ambiguous
   33 |     for (itor = hash[i].begin(); itor != hash[i].end();) {
      |                 ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_bvector.h:61,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/vector:68,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/queue:61,
                 from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
foo.cc:19:12: note:                 'std::vector<int> hash [999987]'
   19 | vector<int>hash[mod];
      |            ^~~~
foo.cc:33:42: error: reference to 'hash' is ambiguous
   33 |     for (itor = hash[i].begin(); itor != hash[i].end();) {
      |                                          ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_bvector.h:61,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/vector:68,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/queue:61,
                 from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
foo.cc:19:12: note:                 'std::vector<int> hash [999987]'
   19 | vector<int>hash[mod];
      |            ^~~~
foo.cc:35:20: error: reference to 'hash' is ambiguous
   35 |             itor = hash[i].erase(itor);
      |                    ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_bvector.h:61,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/vector:68,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/queue:61,
                 from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
foo.cc:19:12: note:                 'std::vector<int> hash [999987]'
   19 | vector<int>hash[mod];
      |            ^~~~
foo.cc: In function 'void insert(int)':
foo.cc:49:5: error: reference to 'hash' is ambiguous
   49 |     hash[x % mod].push_back(x); //插入
      |     ^~~~
In file included from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/stl_bvector.h:61,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/vector:68,
                 from /nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/queue:61,
                 from foo.cc:2:
/nix/store/lwv26rw55rr8k8dc9217ifp5sb0fr9k4-gcc/include/c++/11.3.0/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
foo.cc:19:12: note:                 'std::vector<int> hash [999987]'
   19 | vector<int>hash[mod];
      |            ^~~~
foo.cc: At global scope:
foo.cc:51:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   51 | main() {
      | ^~~~
foo.cc: In function 'int main()':
foo.cc:4:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::queue<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    4 | #define max(x,y) ((x)>(y)?(x):(y))
      |                   ~~~^~~~
foo.cc:80:15: note: in expansion of macro 'max'
   80 |         ans = max(ans, q.size());
      |               ^~~
foo.cc:4:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::queue<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    4 | #define max(x,y) ((x)>(y)?(x):(y))
      |                   ~~~^~~~
foo.cc:90:15: note: in expansion of macro 'max'
   90 |         ans = max(ans, q.size());
      |               ^~~
正在同步测试数据,请稍后
Found 10 testcases.
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1511 收集雪花
题目数据
下载
语言
C++
递交时间
2022-08-14 11:38:55
评测时间
2022-08-14 11:38:55
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes