Problem eelimination
User yoshiokalili
Submission Time 2026-02-14 23:16:01
Score 0
Max Time N/A
Max Memory N/A

Compile Error

eelimination.cpp: In function ‘int main()’:
eelimination.cpp:20:14: error: cannot convert ‘std::stack<int>::empty’ from type ‘bool (std::stack<int>::)() const’ to type ‘bool’
20 | while (!st.empty && arr[st.top()] < arr[i]) {
| ^~~~~
eelimination.cpp:20:14: error: in argument to unary !
eelimination.cpp:24:11: error: no matching function for call to ‘std::stack<int>::push()’
24 | st.push();
| ^
In file included from /usr/include/c++/9/stack:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:89,
from eelimination.cpp:1:
/usr/include/c++/9/bits/stl_stack.h:233:7: note: candidate: ‘void std::stack<_Tp, _Sequence>::push(const value_type&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; std::stack<_Tp, _Sequence>::value_type = int]’
233 | push(const value_type& __x)
| ^~~~
/usr/in