上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 31 下一页
摘要: #include #include#includeusing namespace std;char a[10002];int b[10002];int n,ans;int dp(int x){ int i,j,max; b[0]=1; for(i=1;i>n;for(i=1;i#include#... 阅读全文
posted @ 2014-08-12 17:16 2014acm 阅读(74) 评论(0) 推荐(0) 编辑
摘要: //记忆式搜索 #include #include#includeusing namespace std;char a[10002];int b[10002];int n,ans;int f(int x){ int i,t; if(b[x]>0) return b[x]; b[x]=1; for(... 阅读全文
posted @ 2014-08-12 17:08 2014acm 阅读(188) 评论(0) 推荐(0) 编辑
摘要: #include #include#includeusing namespace std;char a[10002];int b[10002];int n,ans;int f(int x){ int i,t; for(i=0;i>n;for(i=1;i#include#includeusing n... 阅读全文
posted @ 2014-08-12 17:04 2014acm 阅读(201) 评论(0) 推荐(0) 编辑
摘要: hnldyhy(303882171) 11:28:19poj 1088//DP #include using namespace std; int a[102][102],b[102][102]; int r, c,ans; int f( int i, int j ) { int max... 阅读全文
posted @ 2014-08-12 16:49 2014acm 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 不能通过---------------递推,,,,自顶向下*************************************************************************************************************************... 阅读全文
posted @ 2014-08-12 16:43 2014acm 阅读(166) 评论(0) 推荐(0) 编辑
摘要: //记忆式搜索 #include #include using namespace std; int a[101][101],n,b[101][101]; int f(int i,int j) { if ( b[i][j]!=-1 ) return b[i][j]; if ( i==n... 阅读全文
posted @ 2014-08-12 16:28 2014acm 阅读(143) 评论(0) 推荐(0) 编辑
摘要: #include #includeusing namespace std;int a[1005][1005],b[1005][1005];int n;int max(int x, int y){ return x>y?x:y ; }int f(int i,int j){ if(b[... 阅读全文
posted @ 2014-08-12 15:59 2014acm 阅读(121) 评论(0) 推荐(0) 编辑
摘要: #include //2084 hdu c++#includeusing namespace std;int a[105][105],b[105][105];int n;int max(int x, int y){ return x>y?x:y ; }int f(int i,int... 阅读全文
posted @ 2014-08-12 15:56 2014acm 阅读(159) 评论(0) 推荐(0) 编辑
摘要: //本题用DP算法: 从一组数据中找一组递增数列且和为最大,假如我们从最后面往前找,每次都要找出前面比本身的小的数 ,//并加上f[j],就是此时f[j]最大的值//用f[ ]记下相应的位置的最大和,f[ i ]=max(num[ i ] ,f[ i ]+num[ j ] ),其中0num[ j ]... 阅读全文
posted @ 2014-08-12 11:29 2014acm 阅读(87) 评论(0) 推荐(0) 编辑
摘要: #include#include using namespace std;int n,a[1001],b[1001];int main(){ int i,j,best=0; scanf("%d",&n); for(i=1;ia[j]&&b[j]>maxx) maxx=b[j]; b[i]=maxx... 阅读全文
posted @ 2014-08-12 10:33 2014acm 阅读(101) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 31 下一页