answer.code: In function ‘int richest(int, int, int)’:
answer.code:11:5: error: ‘vector’ was not declared in this scope
11 | vector<int> local_maxima; // 存储每组的局部最大值
| ^~~~~~
answer.code:11:5: note: suggested alternatives:
In file included from /usr/include/c++/13/vector:66,
from richest.h:4,
from answer.code:1:
/usr/include/c++/13/bits/stl_vector.h:425:11: note: ‘std::vector’
425 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/usr/include/c++/13/vector:86:13: note: ‘std::pmr::vector’
86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
answer.code:11:12: error: expected primary-expression before ‘int’
11 | vector<int> local_maxima; // 存储每组的局部最大值
| ^~~
answer.code:15:19: error: ‘min’ was not declared in this scope
15 | int end = min(start + group_size, N);
| ^~~
answer.code:15:19: note: suggested alternatives:
In file included from /usr/include/c++/13/vector:62:
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: ‘std::min’
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
In file included from /usr/include/c++/13/tuple:44,
from /usr/include/c++/13/bits/uses_allocator_args.h:38,
from /usr/include/c++/13/bits/memory_resource.h:41,
from /usr/include/c++/13/vector:80:
/usr/include/c++/13/bits/ranges_util.h:733:29: note: ‘std::ranges::min’
733 | inline constexpr __min_fn min{};
| ^~~
answer.code:23:16: error: expected primary-expression before ‘int’
23 | vector<int> a;
| ^~~
answer.code:24:16: error: expected primary-expression before ‘int’
24 | vector<int> b;
| ^~~
answer.code:27:13: error: ‘a’ was not declared in this scope
27 | a.push_back(current_max);
| ^
answer.code:28:13: error: ‘b’ was not declared in this scope
28 | b.push_back(i);
| ^
answer.code:32:16: error: expected primary-expression before ‘int’
32 | vector<int> res = ask(a, b);
| ^~~
answer.code:35:28: error: ‘res’ was not declared in this scope
35 | for(int i = 0; i < res.size(); i++) {
| ^~~
answer.code:36:26: error: ‘b’ was not declared in this scope
36 | if(res[i] == b[i]) {
| ^
answer.code:43:9: error: ‘local_maxima’ was not declared in this scope
43 | local_maxima.push_back(current_max);
| ^~~~~~~~~~~~
answer.code:47:8: error: ‘local_maxima’ was not declared in this scope
47 | if(local_maxima.size() == 1) {
| ^~~~~~~~~~~~
answer.code:53:22: error: ‘local_maxima’ was not declared in this scope
53 | int global_max = local_maxima[0];
| ^~~~~~~~~~~~
answer.code:54:12: error: expected primary-expression before ‘int’
54 | vector<int> a_final;
| ^~~
answer.code:55:12: error: expected primary-expression before ‘int’
55 | vector<int> b_final;
| ^~~
answer.code:58:9: error: ‘a_final’ was not declared in this scope
58 | a_final.push_back(global_max);
| ^~~~~~~
answer.code:59:9: error: ‘b_final’ was not declared in this scope
59 | b_final.push_back(local_maxima[i]);
| ^~~~~~~
answer.code:63:12: error: expected primary-expression before ‘int’
63 | vector<int> res_final = ask(a_final, b_final);
| ^~~
answer.code:66:24: error: ‘res_final’ was not declared in this scope
66 | for(int i = 0; i < res_final.size(); i++) {
| ^~~~~~~~~
answer.code:67:28: error: ‘b_final’ was not declared in this scope
67 | if(res_final[i] == b_final[i]) {
| ^~~~~~~