When FJ's friends visit him on the farm, he likes to show them around. His farm comprises N (1 <= N <= 1000) fields numbered 1..N, the first of which ...
分类:
其他好文 时间:
2019-01-20 18:56:22
阅读次数:
148
题目描述 Farmer John and his cows are planning to leave town for a long vacation, and so FJ wants to temporarily close down his farm to save money in the ...
分类:
其他好文 时间:
2019-01-19 11:27:42
阅读次数:
184
Farmer John's farm consists of a long row of N (1 <= N <= 100,000)fields. Each field contains a certain number of cows, 1 <= ncows <= 2000. FJ wants t ...
分类:
其他好文 时间:
2018-12-22 16:46:50
阅读次数:
205
题目描述 Farmer John is herding his N cows (1 <= N <= 2,500) across the expanses of his farm when he finds himself blocked by a river. A single raft is av ...
分类:
其他好文 时间:
2018-11-20 00:09:57
阅读次数:
187
Mirko works on a pig farm that consists of M locked pig-houses and Mirko can't unlock any pighouse because he doesn't have the keys. Customers come to ...
分类:
其他好文 时间:
2018-11-09 00:50:12
阅读次数:
179
P2921 [USACO08DEC]在农场万圣节Trick or Treat on the Farm 题意翻译 题目描述 每年,在威斯康星州,奶牛们都会穿上衣服,收集农夫约翰在N(1<=N<=100,000)个牛棚隔间中留下的糖果,以此来庆祝美国秋天的万圣节。 由于牛棚不太大,FJ通过指定奶牛必须遵 ...
分类:
其他好文 时间:
2018-10-30 19:29:36
阅读次数:
262
P2907 [USACO08OPEN]农场周围的道路Roads Around The Farm 基础dfs,按题意递归即可。 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #define re register 5 usi ...
分类:
其他好文 时间:
2018-10-27 17:10:45
阅读次数:
210
P2919 [USACO08NOV]守护农场Guarding the Farm 相似题:P3456 [POI2007]GRZ-Ridges and Valleys 每次bfs海拔相同的块,根据与周围的块的大小关系判断是否是山丘。 1 #include<iostream> 2 #include<cst ...
分类:
其他好文 时间:
2018-10-27 16:39:19
阅读次数:
125
传送门 DP 设 f [ i ] [ j ] [ k ] 表示已经走了 i 步,向上走了 j 步,向右走了 k 步时能拯救的最多奶牛数(j,k可以为负,表示反向) 设 g [ i ] [ j ] 表示牛向上走 i 步,向右走 j 步后有多少奶牛恰好在草堆上(同样 i , j 可负) 那么 f [ i ...
分类:
其他好文 时间:
2018-10-27 11:57:23
阅读次数:
169
题意: 给出一个由n个点组成的凸包,以及凸包内的k个点,问是否能够在凸包上选择最多2k个点构造一个新的 凸包,使得新的凸包覆盖原来的k个点。 要求2k个点覆盖原本的k个点,只要对原k个点构造凸包,然后选择该凸包内一点O与该凸包的顶点连一条射线,其 与大凸包相交的边的两端点即为要保留的点,小凸包的顶点 ...
分类:
其他好文 时间:
2018-10-24 19:59:08
阅读次数:
165