二分。 #include #include #include using namespace std; const int maxn = 50000 + 10; int n,k,l,r,mid,ans,d; int a[maxn]; bool check(int dist) { dist=2*dis... ...
分类:
其他好文 时间:
2016-05-20 22:14:50
阅读次数:
126
http://poj.org/problem?id=2140 Description The cows in farmer John's herd are numbered and branded with consecutive integers from 1 to N (1 <= N <= 10 ...
分类:
其他好文 时间:
2016-05-19 23:24:30
阅读次数:
237
Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 8122 Accepted: 3674 Description Your friend to the south is interested in building fen ...
分类:
其他好文 时间:
2016-05-19 23:05:27
阅读次数:
234
Problem Description
To improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, he is unaware...
分类:
其他好文 时间:
2016-05-19 01:38:04
阅读次数:
165
题意:给出一个有向图代表牛和牛喜欢的关系,且喜欢关系具有传递性,求出能被所有牛喜欢的牛的总数(除了它自己以外的牛,或者它很自恋)。 思路:这个的难处在于这是一个有环的图,对此我们可以使用tarjan算法求出强连通分量,把强连通分量压缩成一个点,构成一个新的图,这个图一定是没有环的,如果有环就跟强连通 ...
分类:
编程语言 时间:
2016-05-18 21:50:48
阅读次数:
163
题意:有f种菜,d种饮品,每个牛有喜欢的一些菜和饮品,每种菜只能被选一次,饮品一样,问最多能使多少头牛享受自己喜欢的饮品和菜 分析:建边的时候,把牛拆成两个点,出和入 1,源点向每种菜流量为1 2,每种菜连所有喜欢这道菜的牛的入点,流量1 3,每头牛的入点和出点,流量为1 4,每头牛的出点连所有它喜 ...
分类:
其他好文 时间:
2016-05-18 16:00:52
阅读次数:
169
bzoj4579: [Usaco2016 Open]Closing the Farm Description Farmer John and his cows are planning to leave town for a long vacation, and so FJ wants to tem ...
分类:
其他好文 时间:
2016-05-14 15:17:24
阅读次数:
469
bzoj4525: [Usaco2016 Jan]Angry Cows Description 奶牛Bessie设计了一个游戏:“愤怒的奶牛”。游戏的原型是:有一些可爆炸的草堆分布在一条数轴的某些坐标上,玩家用弹弓把一头奶牛发射到数轴上。奶牛砸到数轴上的冲击波会引发附近的草堆爆炸。游戏的目标是玩家用 ...
分类:
其他好文 时间:
2016-05-14 14:06:04
阅读次数:
414
bzoj4578: [Usaco2016 OPen]Splitting the Field Description Farmer John's N cows (3≤N≤50,000) are all located at distinct positions in his two-dimension ...
分类:
其他好文 时间:
2016-05-14 13:57:40
阅读次数:
296
Bull Math
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 14252
Accepted: 7350
Description
Bulls are so much better at math than the cows. They can multipl...
分类:
编程语言 时间:
2016-05-14 01:08:58
阅读次数:
263