[USACO07DEC]观光奶牛Sightseeing Cows 题目描述 Farmer John has decided to reward his cows for their hard work by taking them on a tour of the big city! The cow ...
分类:
其他好文 时间:
2017-09-15 20:31:57
阅读次数:
284
【算法】并查集+平衡树+数学 【题解】 经典哈夫曼距离转切比雪夫距离。 哈夫曼距离:S=|x1-x2|+|y1-y2| 即:max(x1-x2+y1-y2,x1-x2-y1+y2,-x1+x2+y1-y2,-x1+x2-y1+y2) 令X1=x1+y1,Y1=x1-y1, 切比雪夫距离:S=max( ...
分类:
其他好文 时间:
2017-09-15 18:55:21
阅读次数:
115
1648: [Usaco2006 Dec]Cow Picnic 奶牛野餐 Description The cows are having a picnic! Each of Farmer John's K (1 <= K <= 100) cows is grazing in one of N (1 ...
分类:
其他好文 时间:
2017-09-14 23:32:33
阅读次数:
243
The Cow Prom Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2342 Accepted: 1380 Description The N (2 <= N <= 10,000) cows are so excited: ...
分类:
其他好文 时间:
2017-09-14 14:55:45
阅读次数:
191
题面 题目描述 FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wa ...
分类:
其他好文 时间:
2017-09-14 14:52:40
阅读次数:
190
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a numb ...
分类:
其他好文 时间:
2017-09-13 21:19:29
阅读次数:
182
题目链接:http://poj.org/problem?id=3278 题目大意:给你两个数字n,k。可以对n执行操作(n+1,n-1,n*2),问最少需要几次操作使n变成k。 解题思路:bfs,每次走出三步n-1,n+1,n*2入队,直到最后找到答案为止。要注意: ①n不能变为负数,负数无意义,且 ...
分类:
其他好文 时间:
2017-09-12 15:54:21
阅读次数:
108
Description Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are ...
分类:
其他好文 时间:
2017-09-12 13:47:15
阅读次数:
124
Description As a reward for record milk production, Farmer John has decided to start paying Bessie the cow a small weekly allowance. FJ has a set of c ...
分类:
其他好文 时间:
2017-09-12 13:43:04
阅读次数:
194
Farmer John's N (1 <= N <= 50,000) cows (numbered 1..N) are planning to run away and join the circus. Their hoofed feet prevent them from tightrope wa ...
分类:
其他好文 时间:
2017-09-12 13:38:49
阅读次数:
193