2009年7月23日

pku 1837 01背包

摘要: #include <iostream>using namespace std;const int MAXN = 15*25*20;int w[21], v[21];int dp[21][MAXN*2+1];int main(){int C, G;while (scanf("%d %d", &C, &G) != EOF){int i, j, k;memset(dp, 0,... 阅读全文

posted @ 2009-07-23 19:02 ZAFU_VA 阅读(278) 评论(0) 推荐(0)

pku 1836 2*LIS[O(nlogn)]

摘要: #include <iostream>using namespace std;class MAXLINE{public:void init(int);void DP();int LIS(int, int, bool);private:double L[1010];int len;};void MAXLINE::init(int n){len = n;int i;for (i = 0; ... 阅读全文

posted @ 2009-07-23 16:01 ZAFU_VA 阅读(418) 评论(0) 推荐(1)

导航