Problem zooqueue
User innerspace777
Submission Time 2024-06-11 12:45:22
Score 0
Max Time N/A
Max Memory N/A

Compile Error

zooqueue.cpp: In function ‘int32_t main()’:
zooqueue.cpp:17:15: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
17 | arr[i] = max(arr[i - 1], a[i]);
| ^~~
| std::max
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from zooqueue.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:3468:5: note: ‘std::max’ declared here
3468 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
zooqueue.cpp:22:25: error: cannot convert ‘std::set<long long int>::iterator’ {aka ‘std::_Rb_tree_const_iterator<long long int>’} to ‘long long int’ in initialization
22 | int it = s.upper_bound(a[i]);
| ~~~~~~~~~~~~~^~~~~~
| |
| std::set<long long int>::iterator {aka std::_Rb_tree_const_itera