Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power ...
分类:
其他好文 时间:
2018-12-10 14:23:27
阅读次数:
212
题目描述 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 ...
分类:
其他好文 时间:
2018-12-08 11:26:16
阅读次数:
163
题目大意: n头牛,m个崇拜关系,并且崇拜具有传递性 如果a崇拜b,b崇拜c,则a崇拜c 求最后有几头牛被所有牛崇拜 强连通分量内任意两点都能互达 所以只要强联通分量内有一点是 那么其它点也都会是 按照崇拜关系 即a崇拜b就连一条a到b的边 tarjan求得所有强联通分量并染色 而把一个强联通分量缩 ...
分类:
其他好文 时间:
2018-11-24 14:32:09
阅读次数:
164
二维凸包的板子 //minamoto include define rint register int define inf 0x3f3f3f3f using namespace std; const int N=10005; struct node{ double x,y; node(){} no ...
分类:
其他好文 时间:
2018-11-20 16:22:51
阅读次数:
157
题目描述 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
Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning ...
分类:
其他好文 时间:
2018-11-18 14:59:31
阅读次数:
137
Optimal Milking Description: FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 200) cows. A set of p ...
分类:
其他好文 时间:
2018-11-15 19:50:21
阅读次数:
227
浅谈线段树和树状数组: "https://www.cnblogs.com/AKMer/p/9946944.html" 题目传送门: "http://poj.org/problem?id=2182" 线段树,倒着确定每一个数字。因为最后一个是唯一的,得知最后一个是什么之后倒数第二个就是唯一的了。每次询 ...
分类:
其他好文 时间:
2018-11-12 21:20:49
阅读次数:
245
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5950 Farmer John likes to play mathematics games with his N cows. Recently, they are attracted by recur ...
分类:
其他好文 时间:
2018-11-12 13:22:51
阅读次数:
197
嘟嘟嘟 我dp真是太弱了,这么简单dp都不会。 令dp[i]表示前 i 头牛头被遮住了的最低成本。则dp[i] = min{dp[i], dp[j - 1] + c[a[i] - a[j] + 1]} (1 <= j <= i) 然后别忘了预处理后缀最小值。 1 #include<cstdio> 2 ...
分类:
其他好文 时间:
2018-11-05 19:07:54
阅读次数:
151