摘要: 线段树,顺序存储实现#include <stdio.h> #include <string.h> const int maxx=32000; const int maxn=15000; int l[3*(maxx+1)],h[3*(maxx+1)],w[3*(maxx+1)]; int N; int ans[maxn]; void Create(int t,int s,int f) { l[t]=s;h[t]=f; if(s<f) { int mid=(s+f)/2; Create(2*t+1,s,mid); Create(2*t+2,mid+1,f); } } 阅读全文
posted @ 2012-09-29 14:22 lishimin_come 阅读(96) 评论(0) 推荐(0) 编辑