跳到正文

SunShine2012

1036417

欢迎加入 85135, 104966 友好团队 ^_^

这是 2026年10月22日 存档的第 1 版,不是当前版本。查看当前版本

资料、奖项与版本

资料

编号
1036417
抓取

版本

  1. v2当前
  2. v1

吾洛谷
灰名而志于学,
蓝名而立,
绿名而不惑,
橙名而知天命,
红名而耳顺,
紫名而从心所欲,不逾矩。

https://oi-wiki.org/tools/cmd/

https://codeforces.com/submissions/SunShine2012 曾做过的题目

https://3b2kkem2.mule.page

单调栈模板

C++
#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();\
	_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)