启发式分治
bootdubbo
这个作者很懒,什么都没留下…
展开
-
UVA - 1608 Non-boring sequences
We were afraid of making this problem statement too boring, so we decided to keep it short. A sequenceis called non-boring if its every connected subsequence contains a unique element, i.e. an elemen...原创 2019-08-22 15:54:47 · 135 阅读 · 0 评论 -
Removing Stones
题意:给定N,表示N堆石子,每堆石子数为a[],问多少个区间,可以满足“石子总和若为偶数,那么可以两两取来自不同堆的石子,直到取完; 如果为奇数,那么排除其中一个,然后可以两两取来自不同堆的石子,直到取完”。思路:结论是,如果一个区间的区间和大于等于区间最大值的两倍,则这个区间合法。 考虑分治,我们首先找到区间最大值(为了不重复统计,多个最大值时,统一取最左边的,这个可以ST表示实现),然后...原创 2019-08-22 18:36:44 · 118 阅读 · 0 评论 -
Make Rounddog Happy
Problem DescriptionRounddog always has an array a1,a2,⋯,an in his right pocket, satisfying 1≤ai≤n.A subarray is a non-empty subsegment of the original array. Rounddog defines a good subarray as a su...原创 2019-08-22 22:12:00 · 294 阅读 · 0 评论