- 博客(5)
- 资源 (2)
- 收藏
- 关注
原创 poj 1887 Testing the CATCHER_最长上升子序列
题意:题目太长没看,直接看输入输出猜出是最长下降子序列 用了以前的代码直接a了,做法类似贪心,把最小的顺序数存在数组里面,每次二分更新数组得出最长上升子序列 #include #include using namespace std; int main() { int dp[40002],a[40002],n,t,i,low,up,top,mid,max,tmp,k,b[40002],cas
2013-12-02 21:28:50 662
原创 poj 1742 coins_多重背包
题意:给你N个种硬币,价值和数量,知道手表不大于m,问能组成(1~m)的价格有多少种情况 套套上次那题的模板直接就行了,http://blog.csdn.net/neng18/article/details/17060539 #include #include #include using namespace std; #define MAXV 150 #define MAXM 100050
2013-12-02 20:16:57 499
原创 poj 1664 放苹果_整数拆分
题意:略 用手机敲的代码真是泪流满面,终于过了 #include using namespace std; int dp[110][110]; void solve(){ int i,j; memset(dp,0,sizeof(dp)); for(i=1;i<=15;i++) for(j=1;j<=15;j++){ if(i==1||
2013-12-02 19:30:15 540
原创 poj 1276 Cash Machine_多重背包
题意:略 多重背包 #include #include #include using namespace std; #define MAXV 15 #define MAXM 100050 int cash,n,value[MAXV],c[MAXV],f[MAXM],user[MAXM]; int main(){ int i,j,max; while(~scanf("%d%d",&ca
2013-12-01 21:52:19 583
原创 poj 1458 Common Subsequence_最长公共子串
题意:略 求最长公共子串 #include #include #include using namespace std; int dp[500][500]; int max(int a,int b) { return a>b?a:b; } int main() { int i,j,a,b; char s1[400],s2[400]; while(scanf("%s%s",s1,s2)!
2013-12-01 21:49:50 475
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人