随笔分类 - 线段树
摘要:题意: 给你m个机器,n个数,每个机器可以给n个数的某一段排序,求最少使用几个机器,保证可以把这个n个数排好序 题解: dp+线段树 挑战2上的原题,就不多说啦~ include include include include include include define ls x'9')) ch=
阅读全文
摘要:题意: "传送门" 题解: dp+线段树 O(nlogn)最长上升子序列 include include include include include include define ll long long define ls x'9')) ch=getchar(); if(ch==' ') o=
阅读全文
摘要:题意:两种操作。1、将所给区间划分成两个集合,集合中的元素的贡献为a[i]+1,求是否能找出两个集合使两个集合的总贡献相等。2、区间立方(有模数) 题解: 倍增+线段树+搜索(meet in the middle) 区间立方:由于模数比较小,我们可以用倍增预处理某个数的2^j次立方,然后用线段树维护
阅读全文
摘要:Description N children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of them has a card with
阅读全文