摘要: #include int main( ){ int a,b,c,s ; s=0 ;for(a=1; aint main( ){ int a,b,c,s ; s=0 ;for(a=1; a<=9; a++)for(b=0; b<=9; b++)for(c=0; c<=9... 阅读全文
posted @ 2014-08-12 21:33 2014acm 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include int main( ){ int a,b,c,i;for(i=100;iint main( ){ int a,b,c,he,i;for(i=100;iint main( ){ int a,b,c,i,s ; s=0 ;for(i=100;iint m... 阅读全文
posted @ 2014-08-12 21:30 2014acm 阅读(176) 评论(0) 推荐(0) 编辑
摘要: #include int f(int n){ if (n==1) return 1; else return f(n-1)+n; }int main(void){ printf("%d\n",f(100));} 阅读全文
posted @ 2014-08-12 21:23 2014acm 阅读(136) 评论(0) 推荐(0) 编辑
摘要: hnldyhy// poj 1651 矩阵连乘 DP #include #include using namespace std;int dp[103][103],s[103];int main(){ int n,i,j,k,min; cin>>n; for(i=1;i>s[i]... 阅读全文
posted @ 2014-08-12 21:09 2014acm 阅读(155) 评论(0) 推荐(0) 编辑
摘要: #include int dp[12888];int w[3408],d[3408];int max(int x,int y) { return x>y?x:y; }int main(){ int n,m,i,j; while(scanf("%d%d",&n,&m)!=EOF... 阅读全文
posted @ 2014-08-12 21:02 2014acm 阅读(80) 评论(0) 推荐(0) 编辑
摘要: #include#define max(a,b) (a)>(b)?(a):(b)int dp[12888];int w[3408],d[3408];int main(){ int n,m,i,j; while(scanf("%d%d",&n,&m)!=EOF) { for(i=... 阅读全文
posted @ 2014-08-12 21:00 2014acm 阅读(115) 评论(0) 推荐(0) 编辑
摘要: #includeint main(){int a[10][10];int i,j; for(i=0;i#define N 10int main(){int a[N][N], i,j; for(i=0;i#define N 50void YangHui(int a[][N],int n){ int i... 阅读全文
posted @ 2014-08-12 20:57 2014acm 阅读(165) 评论(0) 推荐(0) 编辑
摘要: // 动态规划求最少钱币枚数#include int a[20],c[20][3000],k,n;int min(int x,int y){ return x>y?y:x; }int main(){ int i,j; scanf("%d",&k); for (i=0; i=... 阅读全文
posted @ 2014-08-12 20:44 2014acm 阅读(291) 评论(0) 推荐(0) 编辑
摘要: #includeint max(int x,int y){ int z; if (x>y) z=x; else z=y; return z;}int max(int a,int b){ return a > b ? a : b;}int main(){ int t... 阅读全文
posted @ 2014-08-12 20:26 2014acm 阅读(203) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int dp[1005], w[105],v[105],T,M;int max(int x,int y) { return x>y?x:y; }void f( ){ int i,j; for (i... 阅读全文
posted @ 2014-08-12 20:14 2014acm 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 70 371 10069 11 2#include #include using namespace std;int dp[105][1005], w[105],v[105],T,M;int max(int x,int y){ return x>y?x:y; }void f( ){ ... 阅读全文
posted @ 2014-08-12 20:07 2014acm 阅读(182) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int dp[105][1005], w[105],v[105],T,M,;int max(int x,int y) { return x>y?x:y; }int f(int x,int y){ int t; if (d... 阅读全文
posted @ 2014-08-12 20:05 2014acm 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int dp[105][1005], w[105],v[105],T,M,;int max(int x,int y) { return x>y?x:y; }int f(int x,int y){ int t; if (... 阅读全文
posted @ 2014-08-12 20:04 2014acm 阅读(242) 评论(0) 推荐(0) 编辑
摘要: rqnoj 15 采药 原创 2015年12月14日 09:03:20 标签: c语言 411 原创 2015年12月14日 09:03:20 标签: c语言 411 题目描述 辰辰是个天资聪颖的孩子,他的梦想是成为世界上最伟大的医师。为此,他想拜附近最有威望的医师为师。医师为了判断他的资质,给他出 阅读全文
posted @ 2014-08-12 20:02 2014acm 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int dp[105][1005],w[105],v[105] ;int max(int a,int b) { return a > b ? a : b; }int f(int x,int y){ int t ; if(dp[x][... 阅读全文
posted @ 2014-08-12 19:59 2014acm 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int dp[105][1005],w[105],v[105] ;int max(int a,int b) { return a > b ? a : b; }int f(int x,int y){ int t ; if(dp[x][... 阅读全文
posted @ 2014-08-12 19:54 2014acm 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 物品质量 w[0] w[1] w[2] ....... w[n] 背包容量c T物品价值 v[0] v[1] v[2] ....... v[n] 物品种类 n N(一)设DP(x,y) 表示 从前x项物品中 取出装入 体积为y的背包 的 物品的... 阅读全文
posted @ 2014-08-12 19:26 2014acm 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-08-12 18:58 2014acm 阅读(82) 评论(0) 推荐(0) 编辑
摘要: #include int f(int a,int b){ if(aint f(int a,int b){ if(b==0) return 1 ; if(a#define MAX 200void main( ){ int... 阅读全文
posted @ 2014-08-12 18:43 2014acm 阅读(92) 评论(0) 推荐(0) 编辑
摘要: ZOJ 1027/*zoj 1027 poj 1080 思路: 三种状态,取最大值:s1[i]和s2[j]配 :dp[i-1][j-1]+cost[my[s1[i]]][my[s2[j]]];s1[i]和'-' 配: dp[i-1][j]+cost[my[s1[i]]][my['-']];s2[... 阅读全文
posted @ 2014-08-12 18:39 2014acm 阅读(170) 评论(0) 推荐(0) 编辑