Building roads Problem Description Farmer John's farm has N barns, and there are some cows that live in each barn. The cows like to drop around, so Jo ...
分类:
其他好文 时间:
2017-02-04 20:19:30
阅读次数:
290
Accounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc. All what they ...
分类:
其他好文 时间:
2017-02-04 19:57:29
阅读次数:
297
题目描述 FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numb ...
分类:
其他好文 时间:
2017-02-03 15:48:18
阅读次数:
197
A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run o ...
分类:
其他好文 时间:
2017-02-01 18:07:55
阅读次数:
208
题意: 给定一个有向图,求有多少个顶点是由任何顶点出发都可达的。顶点数<= 10,000,边数 <= 50,000 思路: Korasaju算法把图进行强连通分量分解,在分解的同时得到各个强连通分量拓扑序。唯一可能成为解的就是拓扑序最后的强连通分量,最后再检查这个强连通分量是否能从各个顶点均可达即可 ...
分类:
其他好文 时间:
2017-01-30 12:30:31
阅读次数:
224
Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9022 Accepted: 3992 Description Your friend to the south is interested in building fen ...
分类:
其他好文 时间:
2017-01-28 20:26:18
阅读次数:
303
Mooo Moo 时间限制: 1 Sec 内存限制: 64 MB提交: 5 解决: 4[提交][状态][讨论版] 题目描述 Farmer John has completely forgotten how many cows he owns! He is too embarrassed to go ...
分类:
其他好文 时间:
2017-01-12 21:36:21
阅读次数:
684
Farmer Brown's cows are up in arms, having heard that McDonalds is considering the introduction of a new product: Beef McNuggets. The cows are trying ...
分类:
其他好文 时间:
2017-01-12 20:54:07
阅读次数:
335
题意:把c个牛分进n个摊位,摊位位置已知,所有摊位分布在0 <= xi <= 1,000,000,000,问两头牛间最小距离的最大值。 分析:找所有最小距离取个最大的。所以二分找这个最小的距离,这个最大的最小距离是二分的分界线。贪心来判断当前的最小距离是否能安排下所有的牛。 ...
分类:
其他好文 时间:
2017-01-10 22:26:23
阅读次数:
308