07 2011 档案

2011 7月21日
摘要:一个平凡的人,希望自己不平凡,以为自己不平凡,在这个凡人堆里,那是多大的悲哀啊?读《诛仙》: 如果张小凡从未得到过他的烧火棒,那么他还会认识陆雪琪吗?他会遇见碧瑶吗?他能从对师姐的爱中解脱吗?平凡的人多么的可悲啊!也许平凡的人,有一个不平凡的心态,才可悲。 阅读全文

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

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 宇宙吾心 阅读(198) 评论(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 宇宙吾心 阅读(215) 评论(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 宇宙吾心 阅读(212) 评论(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 宇宙吾心 阅读(228) 评论(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 宇宙吾心 阅读(122) 评论(0) 推荐(0)

zoj 1642
摘要:#include<iostream>#include<fstream>#include<cstring>using namespace std;int n;int map[300];char c1[2001],c2[2001];int dp[2002][2002];void read(){// ifstream cin("in.txt"); int i,j,k; char c; while(cin>>n) { for(i=1;i<=n;i++) { cin>>c>>j; map[(int)c]=j 阅读全文

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

zoj 1636
摘要:#include<iostream>#include<fstream>#include<stdio.h>using namespace std;long long map[501][501];int n,m;void read(){// ifstream cin("in.txt"); int i,j,k,s,t,i1,j1; int cas; scanf("%d",&cas); for(s=1;s<=cas;s++) { printf("Case %d:\n",s); scanf(&q 阅读全文

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

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

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

zoj 1733
摘要:#include<iostream>#include<fstream>#include<cstring>using namespace std;char c1[1001],c2[1001];int dp[1011][1011];void read(){// ifstream cin("in.txt"); int i,j,k; int n1,n2; while(cin>>c1>>c2) { n1=strlen(c1); n2=strlen(c2); for(i=1;i<=n1;i++) for(j=1;j< 阅读全文

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

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 宇宙吾心 阅读(188) 评论(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 宇宙吾心 阅读(185) 评论(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 宇宙吾心 阅读(217) 评论(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 宇宙吾心 阅读(218) 评论(0) 推荐(0)

poj 1606
摘要:#include<iostream>#include<fstream>#include<queue>using namespace std;int n,m,p;struct node{ int s,t;};int pre[1001][1001];node pre1[1001][1001];int v[1001][1001];void print(int s,int t){ int i,j,k; if(pre[s][t]!=-1) { print(pre1[s][t].s,pre1[s][t].t); if(pre[s][t]==1) cout<< 阅读全文

posted @ 2011-07-07 19:12 宇宙吾心 阅读(253) 评论(0) 推荐(0)

poj 2386
摘要:#include<iostream>#include<fstream>#include<queue>using namespace std;int n,m;struct node{ int s,t;};int v[101][101];int move[8][2]={0,1,0,-1,1,0,-1,0,1,-1,1,1,-1,1,-1,-1};int map[101][101];void bfs(int s,int t){ int i,j,k; v[s][t]=1; queue<node> q; node a; a.s=s; a.t=t; q.pu 阅读全文

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

poj 3761
摘要:#include<iostream>#include<fstream>using namespace std;#define MOD 20100713long long n,m;long long pow (int k, int n){ long long r = k, ans = 1; while (n) { if (n & 1) ans = (ans * r) % MOD; r = (r * r) % MOD; n >>= 1; } return ans;}long long f[1000001];void solve(){ long long 阅读全文

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

poj 1150
摘要:#include<iostream>#include<fstream>using namespace std;int get2(int n){ if(n==0) return 0; return n/2+get2(n/2);}int get5(int n){ if(n==0) return 0; return n/5+get5(n/5);}int odd_get(int n,int x){ if(n==0) return 0; return n/10+(n%10>=x)+odd_get(n/5,x);}int getx(int n,int x){ if(n==0) 阅读全文

posted @ 2011-07-07 12:57 宇宙吾心 阅读(341) 评论(0) 推荐(0)

poj 2918
摘要:#include<iostream>#include<fstream>using namespace std;char map[10][10];int empty[82][2];int a[10][10];int b[10][10];int c[10][10];int ok(int s,int t){ return (s-1)/3*3+(t-1)/3+1;}int len;int dfs(int s){ int x,y,i; x=empty[s][0]; y=empty[s][1]; if(s==len+1) { return 1; } for(i=1;i<=9; 阅读全文

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

poj 2248
摘要:#include<iostream>#include<fstream>using namespace std;int n;int ans;int num[20];int a[20];void dfs(int s){ int i,j,k; if(s>11||s>ans) return; if(num[s]==n){ ans=s; for(i=0;i<=ans;i++) a[i]=num[i]; return; } for(i=s;i>=0;i--) { num[s+1]=num[s]+num[i]; if(num[s+1]>n) contin 阅读全文

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

poj 2935
摘要:#include<iostream>#include<fstream>#include<queue>using namespace std;int map[40][40];int ok(int s,int t){ return (s-1)*6+t;}struct e{ int s,t;};int pre[7][7];int pre1[7][7];int pre2[7][7];int sx,sy,ex,ey;int move[4][2]={0,1,0,-1,1,0,-1,0};int v[7][7];void pr(int s){ if(s==0) cout& 阅读全文

posted @ 2011-07-07 11:41 宇宙吾心 阅读(276) 评论(0) 推荐(0)

poj 2245
摘要:#include<iostream>#include<fstream>using namespace std;int n;int a[14];int v[14];void dfs(int s,int t){ int i; if(n-s+t+1<6) return; if(t==6) { for(i=1;i<=n;i++) if(v[i]) cout<<a[i]<<' '; cout<<endl; return; } v[s]=1; dfs(s+1,t+1); v[s]=0; dfs(s+1,t);}void 阅读全文

posted @ 2011-07-07 11:40 宇宙吾心 阅读(161) 评论(0) 推荐(0)

导航