摘要: 链接:https://www.luogu.org/problemnew/show/P2824 题解: 思路非常奇特的一道题 第一次做应该很难想出来。。 考虑一个序列只有0/1 那么将区间排序就只需将0/1放在最前面/最后面即可,这个显然是可以用线段树来维护的 那么考虑原题 我们可以先二分答案,然后将 阅读全文
posted @ 2018-01-31 21:28 尹吴潇 阅读(130) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; #define maxn 100100 int c[maxn],n,m,ans,d[maxn],minn[maxn*5],sum[maxn*5],lazy[maxn*5]; struct re { int a 阅读全文
posted @ 2018-01-31 21:23 尹吴潇 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 单调队列优化: 阅读全文
posted @ 2018-01-31 11:20 尹吴潇 阅读(118) 评论(0) 推荐(0) 编辑