摘要: 和超级钢琴,异或之三倍经验 $?$ 堆+贪心素质三连 $?$ 好无聊...... code: #include <bits/stdc++.h> #define N 500006 #define ll long long #define setIO(s) freopen(s".in","r",stdi 阅读全文
posted @ 2019-11-26 20:46 EM-LGH 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 和超级钢琴几乎是同一道题吧... code: #include <bits/stdc++.h> #define N 200006 #define ll long long #define setIO(s) freopen(s".in","r",stdin) , freopen(s".out","w" 阅读全文
posted @ 2019-11-26 20:15 EM-LGH 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 思路倒是不难,但是这题卡常啊 ~ code: #include <bits/stdc++.h> #define N 2000004 #define M 1000005 #define SIZE 2000005 #define setIO(s) freopen(s".in","r",stdin) us 阅读全文
posted @ 2019-11-26 19:09 EM-LGH 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 开始想到了一个二分+主席树的 $O(n\log^2 n)$ 的做法. 能过,但是太无脑了. 看了一下题解,有一个 ST 表+堆的优美解法. 你发现肯定是选取前 k 大最优. 然后第一次选的话直接选固定左端点,最优的右端点就行. 但是呢,这个右端点选完后就不能再选了,于是你把这个区间分成两个,再扔到堆 阅读全文
posted @ 2019-11-26 16:29 EM-LGH 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 开始想了一个二分+可持久化trie验证,比正解多一个 log 仔细思考,你发现你可以直接按位枚举,然后在可持久化 trie 上二分就好了. code: #include <bits/stdc++.h> #define N 700005 #define setIO(s) freopen(s".in", 阅读全文
posted @ 2019-11-26 14:55 EM-LGH 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 强行把序列问题放树上,好无聊啊~ code: #include <bits/stdc++.h> #define N 200005 #define setIO(s) freopen(s".in","r",stdin) using namespace std; int tot,edges,tim; in 阅读全文
posted @ 2019-11-26 13:23 EM-LGH 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 这个是真——可持久化字典树..... code: #include <bits/stdc++.h> #define N 100006 #define setIO(s) freopen(s".in","r",stdin) using namespace std; int n,edges,Q,tot; 阅读全文
posted @ 2019-11-26 10:56 EM-LGH 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 链表这个东西非常好用啊 ~ code: #include <bits/stdc++.h> #define N 50010 #define inf 2000400000 #define setIO(s) freopen(s".in","r",stdin) using namespace std; in 阅读全文
posted @ 2019-11-26 09:05 EM-LGH 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 模板题,刷点数据结构 ~ code: #include <bits/stdc++.h> #define N 600009 #define setIO(s) freopen(s".in","r",stdin) using namespace std; int rt[N],sum[N],tot; str 阅读全文
posted @ 2019-11-26 07:51 EM-LGH 阅读(146) 评论(0) 推荐(0) 编辑