
单调队列
吴俊达9812
这个作者很懒,什么都没留下…
展开
-
bzoj 1293: [SCOI2009]生日礼物
学习了一种前向星的写法 #include <bits/stdc++.h> using namespace std; typedef int lint; typedef long long LL; const int maxm = 2000000; const int maxn = 2000000; int ver[maxm],ne[maxm],he[maxn],tot; void ...原创 2019-08-24 11:06:36 · 108 阅读 · 0 评论 -
BZOJ1047(二维单调队列模板)
思路:我们先将每一行的相邻k列求出最大值和最小值,再按照行来进行单调对列。 #include <bits/stdc++.h> using namespace std; const int maxn = 2000; int a[maxn][maxn],mn[maxn][maxn],mx[maxn][maxn],mn2[maxn][maxn],mx2[maxn][maxn]; int ...原创 2019-08-31 21:17:31 · 242 阅读 · 0 评论