Layout
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 7613
Accepted: 3658
Description
Like everyone else, cows like to stand close to their friend...
分类:
其他好文 时间:
2015-02-11 18:35:35
阅读次数:
177
Description
Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others.
Farmer John has cooked fabulous meals for his cows, but he forgo...
分类:
其他好文 时间:
2015-02-10 00:40:03
阅读次数:
261
题目链接:http://poj.org/problem?id=2456
题意:有一排n个牛舍,坐标分别为xi,有m头牛,希望尽可能把他们之间分开,求他们之间最近的两头牛之间的距离最大可以拉到多少。这是二分中最大化最小值的题目,英文的题目又最大又最小有的人不易理解。
思路:显然两头最近的牛的距离太大将没有一种方式安置在牛舍中,两头最近的牛距离越小就越能放置在牛舍中,所以用把答案二分出来,每个mi...
分类:
其他好文 时间:
2015-02-08 09:03:06
阅读次数:
137
Farmer John's cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his field is particularly good.
Farmer John has N cows (we number the cows from 1 to N). Each of Farmer Joh...
分类:
编程语言 时间:
2015-02-06 09:41:36
阅读次数:
201
Lost Cows
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9477
Accepted: 6110
Description
N (2 <= N <= 8,000) cows have unique brands in the range 1..N. In...
分类:
编程语言 时间:
2015-02-06 09:36:34
阅读次数:
125
Cheapest Palindrome
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 6186
Accepted: 3014
Description
Keeping track of all the cows can be a tricky task so F...
分类:
其他好文 时间:
2015-02-05 18:24:56
阅读次数:
146
题意:输入多个时间段,表示喂牛的时间,问喂牛的最长的持续时间和不喂牛的最长的时间。key:注意输入的时间没有先后顺序。有两种方法。一是对时间段进行排序,比较每段时间的的末尾就行了,记得求得最大连续时间的时候要更新最后的时间,更新最大间断时间的时候要更新最前面的时间。方法二,用数组标记喂牛时间,,fo...
分类:
其他好文 时间:
2015-02-04 16:30:04
阅读次数:
207
For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a contiguous range of cows from the...
分类:
其他好文 时间:
2015-02-02 23:19:29
阅读次数:
254
题目大意:每头奶牛都希望自己成为最欢迎的那头牛。给你N头牛,M个崇拜关系(A,B)。
意思是牛A崇拜牛B。特别是,如果牛A崇拜牛B,牛B崇拜牛C,那么牛A也崇拜牛C。那么
问题来了:请计算出被所有牛崇拜的牛的个数。
思路:把崇拜关系(A,B)看做是一条有向边,并且,我们发现牛的崇拜关系具有传递性。那
么只要牛A有一条路径连向牛B,就可以判定牛A崇拜牛B。于是,被所有牛崇拜的牛就是所
有的点都存在一条路径连向它的有向路径。这道题中,将原图强连通分量缩点后构成了DAG,
那么如果新图中出度为0的点只有一个,则有...
分类:
其他好文 时间:
2015-02-02 18:05:26
阅读次数:
246
The Cow Lexicon
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 8341
Accepted: 3941
Description
Few know that the cows have their own dictionary with W...
分类:
其他好文 时间:
2015-02-02 14:16:26
阅读次数:
105