不会做,看了别人的想法 做的
详见原文 http://blog.sina.com.cn/s/blog_6635898a0100kzpx.html
#include <stdio.h>
#define M 100005
struct data
{
int
l,r,max;
}node[3*M];
struct da
{
int
start,end;
}seg[M];
int num[M],hash[M];
int Max (int a,int b)
{
return a
> b?a:b;
}
void C_Tree (int left,int right,int u)
{
node[u].l =
left;
node[u].r =
right;
if (left ==
right)
{
node[u].max = seg[left].end - seg[left].start + 1;
return ;
}
in......
阅读全文