摘要:
dp[i]=min(dp[i],dp[j]+dp[i-j]+m)//dp [i]里放着i只牛渡河最少时间View Code #include<stdio.h>int dp[2509];int a[2509];int min(int a,int b){ return a>b?b:a;}int main(){ int n,m; while(scanf("%d%d",&n,&m)!=EOF) { int i,add=0; for(i=1;i<=n;i++) { int temp; scanf("%d",&temp 阅读全文
posted @ 2011-03-23 22:23 huhuuu 阅读(361) 评论(0) 推荐(0) 编辑