2011年7月10日

zoj 2059

摘要: #include<iostream>#include<fstream>#include<memory.h>using namespace std;int n;int a[101];int dp[101][4004];void read(){// ifstream cin("in.txt"); int i,j,k; while(cin>>n) { if(n<0) return; if(n<=1) { cout<<"Sorry"<<endl; continue; } for( 阅读全文

posted @ 2011-07-10 21:52 宇宙吾心 阅读(193) 评论(0) 推荐(0)

zoj 1985

摘要: #include<iostream>#include<fstream>using namespace std;int n;long long h[100003];int lef[100003];int rig[100003];void read(){// ifstream cin("in.txt"); int i,j,k; while(scanf("%d",&n)) { if(n==0) return; for(i=1;i<=n;i++) scanf("%lld",&h[i]); h[0] 阅读全文

posted @ 2011-07-10 17:37 宇宙吾心 阅读(213) 评论(0) 推荐(0)

zoj 1880

摘要: #include<iostream>#include<fstream>#include<memory.h>using namespace std;int n,m;int a[101];bool dp[51][22951];int abs(int s){ if(s<0) return -s; else return s;}void read(){// ifstream cin("in.txt"); int i,j,k; while(cin>>n) { int sum=0; for(i=1;i<=n;i++) { ci 阅读全文

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

zoj 1953

摘要: #include<iostream>#include<fstream>using namespace std;char c1[101],c2[101];int dp[103][103];int n1,n2;void print(int s,int t){ int i; if(s==0&&t==0) return; if(s==0) { for(i=0;i<t;i++) cout<<c2[i]; return; } if(t==0) { for(i=0;i<s;i++) cout<<c1[i]; return; } if 阅读全文

posted @ 2011-07-10 17:14 宇宙吾心 阅读(226) 评论(0) 推荐(0)

zoj 1883

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

posted @ 2011-07-10 17:14 宇宙吾心 阅读(117) 评论(0) 推荐(0)

导航