码迷,mamicode.com
首页 >  
搜索关键字:cow    ( 1685个结果
Best Cow Line(POJ-3617)
经典的贪心算法。   贪心算法的特点是总是取最优解,最后得到的也是最优,这一点上与动归不同。动归和搜索都是多策略的,所以贪心的理解难度还是很小的。 #include #include #include #include #include #include #include using namespace std; int n,a; vector ans; int main() { sca...
分类:其他好文   时间:2015-04-11 17:58:45    阅读次数:113
POJ 2436 USACO silver
题意: 总共最多有15种疾病 有n头牛,每头牛有di种疾病,分别用1-15之间的数字来表示 要求选择最多头牛 使他们的疾病种数不超过K 思路: 枚举状态,状态是当前有哪几种病,然后判断每头牛是否能选择即可 code: #include #include #include using namespace std; const int maxn = 40000; int cow[10...
分类:其他好文   时间:2015-04-11 17:54:38    阅读次数:104
poj 3281 最大流拆点
Language:DiningTime Limit:2000MSMemory Limit:65536KTotal Submissions:10321Accepted:4744DescriptionCows are such finicky eaters. Each cow has a prefere...
分类:其他好文   时间:2015-04-11 14:45:13    阅读次数:116
Best Cow Line (POJ 3217)
给定长度为N的字符串S,要构造一个长度为N的字符串T,起初,T是一个空串,随后反复进行下列任意操作。*从S的头部删除一个字符,加到T的尾部*从S的尾部删除一个字符,加到T的尾部目标是要构造字典序尽可能小的字符串T模拟情景,想出来一个有意思的比喻,写出来程序,俩个推土机开始在互相看不到对方的直线工作推...
分类:其他好文   时间:2015-04-10 11:04:46    阅读次数:125
POJ 3627 Bookshelf (贪心)
Description Farmer John recently bought a bookshelf for cow library, but the shelf is getting filled up quite quickly, and now the only available space is at the top. Each of the N cows (1 ≤ N ≤ 20,...
分类:其他好文   时间:2015-04-09 21:54:52    阅读次数:153
POJ-3268
Silver Cow PartyTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 13738Accepted: 6195DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) con...
分类:其他好文   时间:2015-04-09 21:23:32    阅读次数:121
(有向图欧拉回路求解) poj 2230
WatchcowTime Limit:3000MSMemory Limit:65536KTotal Submissions:6255Accepted:2708Special JudgeDescriptionBessie's been appointed the new watch-cow for t...
分类:其他好文   时间:2015-04-07 00:42:43    阅读次数:132
连通图练习总结
连通图是图论基于联通的一个概念,在ACM中针对图论的考察一部分是也是基于连通图。针对这类问题的解题基本思路就是先求出对应的连通分量(有向图的强连通,无向图的双连通)对图进行简化,然后再结合其他算法计算。1. POJ 3180The Cow Prom这个题如果能理解题目的话,怎么做就很明显了,能形成一...
分类:其他好文   时间:2015-04-06 12:45:32    阅读次数:160
1623: [Usaco2008 Open]Cow Cars 奶牛飞车
1623: [Usaco2008 Open]Cow Cars 奶牛飞车Time Limit:5 SecMemory Limit:64 MBSubmit:291Solved:201[Submit][Status][Discuss]Description编号为1到N的N只奶牛正各自驾着车打算在牛德比亚的...
分类:其他好文   时间:2015-04-06 11:18:47    阅读次数:152
3893: [Usaco2014 Dec]Cow Jog
3893: [Usaco2014 Dec]Cow JogTime Limit:10 SecMemory Limit:128 MBSubmit:174Solved:87[Submit][Status][Discuss]DescriptionThe cows are out exercising the...
分类:其他好文   时间:2015-04-05 23:11:12    阅读次数:247
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!