题面: 传送门 思路: 题意有点绕,实际上就是给你一个计算规则,让你取最少的元素,通过这个计算方式,得到一个小于指定误差上限的结果 这个规则分为三个部分,这里分别用pre,sum,suf表示 因为给定的元素个数(天数)很少,可以使用O(n^3)算法,因此考虑使用经过了预处理的dp解决问题 具体地,设 ...
分类:
其他好文 时间:
2018-02-21 19:40:28
阅读次数:
135
题目 题目描述 Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of th ...
分类:
其他好文 时间:
2018-02-11 23:43:46
阅读次数:
314
题意:求最长的可重叠的 K重复子串 的长度 考虑二分长度s,转化为验证性问题。 对SA进行分组。保证组内Height最小为s。这样在组内RMQ就可以任意了,因为RMQ一定是大于S的。 只要组内元素个数大于等于K就是可行解。 ...
分类:
其他好文 时间:
2018-02-11 21:32:47
阅读次数:
180
题目描述 Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy ...
分类:
其他好文 时间:
2018-02-10 21:22:46
阅读次数:
140
BZOJ_2058_[Usaco2010 Nov]Cow Photographs_逆序对 题意: 奶牛的图片 Farmer John希望给他的N(1<=N<=100,000)只奶牛拍照片,这样他就可以向他的朋友炫耀他的奶牛.这N只奶牛被标号为1..N. 在照相的那一天,奶牛们排成了一排.其中第i个位 ...
分类:
其他好文 时间:
2018-02-10 16:56:40
阅读次数:
167
题目链接 "bzoj 1717: [Usaco2006 Dec]Milk Patterns 产奶的模式" 题解 后缀排序 求出height之后一段区间[l,r]内,出现r l+1次最长的串是$min(height[i]) l include include const int maxn = 6000 ...
分类:
其他好文 时间:
2018-02-09 22:34:04
阅读次数:
153
题目 题目描述 Farmer John has decided to bring water to his N (1 <= N <= 300) pastures which are conveniently numbered 1..N. He may bring water to a pasture ...
分类:
其他好文 时间:
2018-02-07 15:09:25
阅读次数:
162
题目 题目描述 Bessie and her sister Elsie want to travel from the barn to their favorite field, such that they leave at exactly the same time from the barn, ...
分类:
其他好文 时间:
2018-02-06 01:06:59
阅读次数:
175
题目描述 看下面的五张 9 x 8 的图像: ........ ........ ........ ........ .CCC.... EEEEEE.. ........ ........ ..BBBB.. .C.C.... E....E.. DDDDDD.. ........ ..B..B.. . ...
分类:
其他好文 时间:
2018-02-04 15:36:15
阅读次数:
157
Description 公交车一共经过N(1 include include include include define inf 0x7f7f7f typedef long long ll; typedef unsigned int ui; typedef unsigned long long u ...
分类:
其他好文 时间:
2018-02-04 00:31:01
阅读次数:
93