版本比较
SunShine2012
个人介绍
增加 1 行删除 3 行
14 行未改动151617181919202122232214 行未改动## 单调栈模板```cpp#define mono(_a, _e, _st, _op, _ans)\for (ll i = 1; i <= _e; i++){\ while (!_st.empty() && _a[_st.top()] _op _a[i]) _ans[_st.top()] = i, _st.pop();\ while (!_st.empty() && _a[i] _op _a[_st.top()]) _ans[_st.top()] = i, _st.pop();\ _st.push(i);\}for (ll i = 1; i <= _e; i++) if (!_ans[i]) _ans[i] = _e + 1;
// mono(a, n, g, <, gans) mono(a, n, l, >, lans)```