摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1698 #include<cstdio>#include<algorithm>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int maxn=111111;int h,w,n,col[maxn<<2],s... 阅读全文
posted @ 2012-08-31 11:07 Yogurt Shen 阅读(160) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4027 #include<cstdio>#include<cstring>#include<cmath>#include<algorithm>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define maxn 100001using namespace... 阅读全文
posted @ 2012-08-31 11:05 Yogurt Shen 阅读(132) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2852 #include<cstdio>#include<cstring>#include<algorithm>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define maxn 100010using namespace std;int sum[ma... 阅读全文
posted @ 2012-08-31 11:03 Yogurt Shen 阅读(138) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2182 #include<stdio.h>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define maxn 8080int tree[maxn<<2],d1[maxn],ans[maxn];void build(int l,int r,int rt){ tree[rt]=r-... 阅读全文
posted @ 2012-08-31 11:01 Yogurt Shen 阅读(184) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1556 #include<cstdio>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define MAX 100001int tree[MAX<<2];; void build(int l,int r,int rt){ tree[rt]=0; ... 阅读全文
posted @ 2012-08-31 11:00 Yogurt Shen 阅读(159) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2828 #include<stdio.h>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn=200001;int pos[maxn],val[maxn],ans[maxn],em[maxn<<2],index;void build(int l,int r,int... 阅读全文
posted @ 2012-08-31 10:58 Yogurt Shen 阅读(175) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2795 #include<cstdio>#include<algorithm>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int maxn=222222;int h,w,n,MAX[maxn<<2];v... 阅读全文
posted @ 2012-08-31 10:56 Yogurt Shen 阅读(166) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1394 #include<cstdio>#include<algorithm>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int maxn=5555;int sum[maxn<<2],x[maxn];v... 阅读全文
posted @ 2012-08-31 10:53 Yogurt Shen 阅读(253) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1754 #include<cstdio>#include<algorithm>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int maxn=222222;int MAX[maxn<<2];void Pu... 阅读全文
posted @ 2012-08-31 10:51 Yogurt Shen 阅读(220) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1166 线段树第一题 #include<cstdio>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn=55555;int sum[maxn<<2];void PushUP(int rt) { sum[rt]=sum[rt... 阅读全文
posted @ 2012-08-31 10:49 Yogurt Shen 阅读(256) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio>#include<cstring>#include<algorithm>using namespace std;int dp[1010],a[1010];int main(void){ int n,m,i,j,k,Max; while(scanf("%d",&n),n) { Max=0; for(i=1;i<=n;... 阅读全文
posted @ 2012-08-31 10:43 Yogurt Shen 阅读(156) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1561 #include<cstdio>#include<cstring>#include<algorithm>using namespace std;int n,m,num[250],map[250][250],dp[250][250],vis[250];void dfs(int p){ int ... 阅读全文
posted @ 2012-08-31 10:42 Yogurt Shen 阅读(194) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1787 #include<stdio.h>#include<string.h>int C[4],ans[30],p[10010],vis[10010],dp[10010],T[4]={1,5,10,25};int main(void){ int m,i,j,sum; while(scanf("%d",&m)!=EOF) ... 阅读全文
posted @ 2012-08-31 10:39 Yogurt Shen 阅读(315) 评论(0) 推荐(0) 编辑
摘要: http://acmpj.zstu.edu.cn/JudgeOnline/showproblem?problem_id=3286 #include<cstdio>#include<cstring>#include<algorithm>#define INF 1<<29using namespace std; int dp[51][100003],c[11],v[11],n,w,p,m,i,... 阅读全文
posted @ 2012-08-31 10:36 Yogurt Shen 阅读(223) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1742 #include<stdio.h>#include<string.h>int dp[100010],C[110],A[110],vis[100010];int main(void){ int n,m,i,j,ans; while(scanf("%d%d",&n,&m),n||m) { for(i=... 阅读全文
posted @ 2012-08-31 10:32 Yogurt Shen 阅读(116) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3260 #include<cstdio>#include<cstring>#include<algorithm>#define INF 1<<29using namespace std;int T,N,V[1001],C[1001],buy[40000],sell[40000],i,j,k,maxv,ans;int main(void)... 阅读全文
posted @ 2012-08-31 10:26 Yogurt Shen 阅读(219) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2063 #include<cstdio>#include<algorithm>using namespace std;int dp[1000000],w[11],v[11],sum,n,y;int main(void){ int t,i,j,V; scanf("%d",&t); while(t--) { ... 阅读全文
posted @ 2012-08-31 10:23 Yogurt Shen 阅读(106) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1252 #include<cstdio>#include<algorithm>using namespace std;const int INF=20000000;const int MAXV=100*100+100+1;int f[MAXV],a[6],t,i,j,maxV,tot,_max;float ave;int main(vo... 阅读全文
posted @ 2012-08-31 10:20 Yogurt Shen 阅读(247) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1114 #include<cstdio>#include<cstring>#include<algorithm>#define INF 1000000000using namespace std;int dp[20000],P[1000],W[1000],E,F,N,M;int main(void){ ... 阅读全文
posted @ 2012-08-31 10:10 Yogurt Shen 阅读(154) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3535 #include<cstdio>#include<cstring>#include<algorithm>using namespace std;int dp[110][110],c[110],g[110],n,T,i,j,k,m,s;void case0(){ for(j=0;j<=T;j+... 阅读全文
posted @ 2012-08-31 10:07 Yogurt Shen 阅读(226) 评论(0) 推荐(0) 编辑