2011年7月8日

zoj 1524

摘要: #include<iostream>#include<fstream>#include<memory.h>using namespace std;int a[101];int p[100001];double q[100001];double dp[2][100001];int n,m;void read(){// ifstream cin("in.txt"); int i,j,k; while(cin>>n>>m) { if(n==0&&m==0) return; for(i=1;i<=n; 阅读全文

posted @ 2011-07-08 18:20 宇宙吾心 阅读(186) 评论(0) 推荐(0)

zoj 1563

摘要: #include<iostream>#include<fstream>using namespace std;int p[101];int sum[101];int dp[101];int n;void read(){// ifstream cin("in.txt"); int i,j,k; int cas; cin>>cas; while(cas--) { cin>>n; for(i=1;i<=n;i++) { cin>>j>>p[i]; sum[i]=sum[i-1]+j; } for(i=1 阅读全文

posted @ 2011-07-08 16:23 宇宙吾心 阅读(181) 评论(0) 推荐(0)

zoj 1196

摘要: #include<iostream>#include<fstream>#include<cmath>#include<memory.h>using namespace std;int a[201];int w[201][201];int dp[201][31];int n,m;int abs(int s){ if(s>0) return s; else return -s;}void read(){// ifstream cin("in.txt"); int i,j,k,s,t; int cas=0; while(cin 阅读全文

posted @ 2011-07-08 15:08 宇宙吾心 阅读(212) 评论(0) 推荐(0)

zoj 1163

摘要: #include<iostream>#include<fstream>using namespace std;double dp[501][501];int n;void read(){// ifstream cin("in.txt"); int i,j,k; for(i=0;i<=500;i++) dp[0][i]=1; for(i=1;i<=500;i++) for(j=1;j<=500;j++) { dp[i][j]=dp[i][j-1]; if(i>=j) dp[i][j]+=dp[i-j][j-1]; } while 阅读全文

posted @ 2011-07-08 14:42 宇宙吾心 阅读(212) 评论(0) 推荐(0)

导航