摘要: 双指针并非要满足单调性才可以用,他也可以维护滑动窗口 #include<iostream> #include<algorithm> using namespace std; const int N = 100010; int n, d, k; #define PII pair<int, int> # 阅读全文
posted @ 2020-09-25 21:32 yys_c 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 找长度为k的窗口中的最大值(单调减队列),最小值(单调增队列) #include<iostream> using namespace std; const int N = 1000010; int n, k; int a[N]; int q[N], hh = -1, tt = 0; int main 阅读全文
posted @ 2020-09-25 20:42 yys_c 阅读(95) 评论(0) 推荐(0) 编辑