随笔分类 -  数据结构:单调队列

摘要:考虑为什么队头就是最优决策: 因为我们要找的是sum的最小值,单调队列内存储了所有可能的决策集合,而对头又是最小的 所以取对头转移就可以 #include <iostream> #include <cstdio> #include <cstring> #include <queue> using n 阅读全文
posted @ 2022-01-15 22:19 __iostream 阅读(20) 评论(0) 推荐(0) 编辑
摘要:求窗口内最大值 #include <iostream> #include <cstdio> #include <queue> using namespace std; const int N=1e6+10; const int INF=0x3f3f3f3f; int read() { int x=0 阅读全文
posted @ 2022-01-15 22:08 __iostream 阅读(29) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示