码迷,mamicode.com
首页 >  
搜索关键字:poj 1979    ( 20310个结果
poj 3616 Milking Time dp
题目大意是一个奶牛可以在一些时间区间产奶,每个区间的产奶量已知,每次产完奶都要休息一下,问最大产奶量。dp方程类似最长上升子序列的n2算法,dp[i]表示以第i个区间结尾最多能产生多少奶。则dp[i] = max(dp[j] + e[i].z)。#include #include #include ...
分类:其他好文   时间:2014-07-16 19:09:37    阅读次数:216
POJ 3468 A Simple Problem with Integers
线段树的指针表示法。代码还有待消化。。代码里面多次用到了函数递归,感觉这次对递归又有了深一层的理解。 1 #define LOCAL 2 #include 3 #include 4 #include 5 using namespace std; 6 7 struct CNode...
分类:其他好文   时间:2014-07-16 19:07:23    阅读次数:249
poj 3254 Corn Fields 状压dp
#include #include using namespace std;#define mod 100000000int M,N,top=0;int cur[20],dp[20][600];int state[600],num[110];bool ok(int x){ if(x&x<<1)...
分类:其他好文   时间:2014-07-16 18:57:07    阅读次数:229
2-SAT入门 poj2749 Building roads
poj2749 Building roadshttp://poj.org/problem?id=2749二分答案,以后构造布尔表达式。 相互讨厌是!((a and b)or(!a and !b) 化简得 (!a or !b)and(a or b) 相互喜欢是!(a and !b)or(!a an.....
分类:其他好文   时间:2014-07-16 18:55:39    阅读次数:203
Poj 1260
2//两个测试用例2//需要购买两种珠宝100 1//需要购买的珠宝数量与价值100 2//31 101 11100 12低价的珠宝可以被高价的珠宝代替,买每种珠宝都必须多买10件,问最少需要花费多少钱#includeusing namespace std;int dp[111],cunt[111]...
分类:其他好文   时间:2014-07-16 18:52:21    阅读次数:279
Poj 1836
81.86 1.86 1.30621 2 1.4 1 1.97 2.2有八个大兵身高如上 求至少出列几个大兵可以站成山形队列#includeusing namespace std;double a[1111];int dp1[1111];int dp2[1111];int main(){ int i...
分类:其他好文   时间:2014-07-16 18:50:36    阅读次数:167
Poj 2533
71 7 3 5 9 4 8求最长上升子序列的个数#includeusing namespace std;int dp[10001];int a[10001];int main(){ int max; int i,j; int n; while(scanf("%d",&n)!=EOF) { max....
分类:其他好文   时间:2014-07-16 18:48:42    阅读次数:244
Poj 3267
Poj 3267题意:6 10Browndcodw 长度为10下面为字典 cowmilkwhiteblackbrownfarmer 让求字符串删除多少字符可以与字典匹配#include#include#includeusing namespace std; int w,l,dp[305];char ...
分类:其他好文   时间:2014-07-16 18:43:38    阅读次数:136
poj 3468 线段树成段更新
http://poj.org/problem?id=3468A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KTotal Submissions:58132Accepted:17704Case Time Limit:...
分类:其他好文   时间:2014-07-16 18:43:16    阅读次数:224
poj 1018
好多人都搜过的。但是排序然后三分代码短且快。同样是过,也有好坏之分。#include #include #include using namespace std;int n;int t;int len[111];int b[111][111];int p[111][111];int a[222222...
分类:其他好文   时间:2014-07-16 00:30:02    阅读次数:365
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!