摘要:
#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
阅读(154)
评论(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
阅读(182)
评论(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
阅读(145)
评论(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
阅读(162)
评论(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
阅读(85)
评论(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
阅读(122)
评论(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
阅读(172)
评论(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
阅读(301)
评论(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
阅读(218)
评论(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
阅读(130)
评论(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
阅读(210)
评论(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
阅读(153)
评论(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
阅读(258)
评论(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
阅读(175)
评论(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
阅读(150)
评论(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
阅读(305)
评论(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
阅读(160)
评论(0)
推荐(0)
摘要:
阅读全文
posted @ 2014-08-12 18:58
2014acm
阅读(87)
评论(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
阅读(102)
评论(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
阅读(180)
评论(0)
推荐(0)
摘要:
// 0-1背包问题的普通递归算法#include #define M 10int w[M]={5,3,2,1},v[M]={4,4,3,1};int limit_w=7,maxv=0,n=4; void find(int i,int tw,int tv) //从第i种物品开始,当前已有的重量tw和... 阅读全文
posted @ 2014-08-12 18:36
2014acm
阅读(141)
评论(0)
推荐(0)
摘要:
#include int n,ans, a[1001],b[1001];int main(){int i,j;scanf("%d",&n);for(i=1;ia[j]&&b[j]+1>b[i]) b[i]=b[j]+1;ans=1;for(i=1;i<=n;i++)if(ans<b[i]) ... 阅读全文
posted @ 2014-08-12 18:28
2014acm
阅读(103)
评论(0)
推荐(0)
摘要:
poj 1836#include #include using namespace std ;const int MAX = 1005 ;double m[MAX] ;int dp1[MAX] , dp2[MAX] ;int main(){ int n ; while ( cin >> ... 阅读全文
posted @ 2014-08-12 18:17
2014acm
阅读(123)
评论(0)
推荐(0)
摘要:
zoj 1733#include #include #define N 1005using namespace std ;char s1[N],s2[N];int dp[N][N];int max(int a,int b){ return a>b ? a : b ; }void f(int... 阅读全文
posted @ 2014-08-12 18:12
2014acm
阅读(117)
评论(0)
推荐(0)
摘要:
#include #include #define N 1005using namespace std ;char s1[N],s2[N];int dp[N][N],ans,len1,len2;int max(int a,int b){ return a>b ? a : b ; }int f(in... 阅读全文
posted @ 2014-08-12 18:10
2014acm
阅读(126)
评论(0)
推荐(0)
摘要:
#include #include #define N 1005using namespace std ;char s1[N],s2[N];int dp[N][N],ans,len1,len2;int max(int a,int b){ return a>b ? a : b ; }int f(in... 阅读全文
posted @ 2014-08-12 18:06
2014acm
阅读(132)
评论(0)
推荐(0)
摘要:
#include#includeint main(){ int students,max=0; int i,j; int a[100],b[100],c[100]; scanf("%d",&students); for(i=0;ib[i]) b[i]=b[j]+1; ... 阅读全文
posted @ 2014-08-12 17:51
2014acm
阅读(203)
评论(0)
推荐(0)
摘要:
#include #define MAX 50+1int fib(int n){ int i,a[MAX]; a[1]=a[2]=1; for (i=3; i<=n; i++) a[i]=a[i-1]+a[i-2]; return a[n];}void main( )... 阅读全文
posted @ 2014-08-12 17:40
2014acm
阅读(203)
评论(0)
推荐(0)
摘要:
#include #define MAX 50+1int a[MAX];int fib(int n){ if (a[n]==-1) return a[n]=fib(n-1)+fib(n-2); else return a[n]; }int main( ){ int i,n;... 阅读全文
posted @ 2014-08-12 17:36
2014acm
阅读(149)
评论(0)
推荐(0)
摘要:
#include int fib(int n){ if (n<=1) return 1; else return fib(n-1)+fib(n-2); }int main( ){ int n; scanf("%d",&n); printf("%d\n" ,fib( ... 阅读全文
posted @ 2014-08-12 17:32
2014acm
阅读(153)
评论(0)
推荐(0)
摘要:
#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
阅读(76)
评论(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
阅读(204)
评论(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
阅读(206)
评论(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
阅读(129)
评论(0)
推荐(0)
摘要:
不能通过---------------递推,,,,自顶向下*************************************************************************************************************************... 阅读全文
posted @ 2014-08-12 16:43
2014acm
阅读(172)
评论(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
阅读(154)
评论(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
阅读(125)
评论(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
阅读(164)
评论(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
阅读(91)
评论(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
阅读(106)
评论(0)
推荐(0)
摘要:
//Time Limit Exceeded 普通递归 自顶向下#include #define N 105 #includeusing namespace std;int a[N][N];int n;int max(int x, int y){ return x>y?x:y ; }int maxs... 阅读全文
posted @ 2014-08-12 10:02
2014acm
阅读(112)
评论(0)
推荐(0)
浙公网安备 33010602011771号