摘要: 【算法】贪心+堆 #include<cstdio> #include<algorithm> using namespace std; const int maxn=20010; int n,heap[maxn],sz; void heap_push(int x) { heap[++sz]=x;//新 阅读全文
posted @ 2016-12-22 21:05 ONION_CYC 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 【算法】树链剖分+线段树 【题解】 树链剖分算法:http://www.cnblogs.com/onioncyc/p/6207462.html 定义线段树结构体有l,r,lc,rc,sum,data。 lc表示左端颜色,rc表示右端颜色,sum表示颜色种类,data表示区间置为同一个数的标记。 修改 阅读全文
posted @ 2016-12-22 19:11 ONION_CYC 阅读(220) 评论(0) 推荐(0) 编辑