认识线段:线段树学习

今天尝试写了一个线段树的题,POI2000 的Promotion,(参考了李睿的论文)一开始建了一个[1,1000000]的线段树,结果超内存了~后来hash了一下,优化了一下结构,但是wrong answer了,最后把所有的int改为了__int64,终于AC了
------------------------------------------题目--------------------------------------------------------------------------------
Description

Great Bytelandish net of supermarkets asked you for writing a program simulating costs of the promotion being prepared.

The promotion has to obey the following rules:

1.A customer, who wants to participate in the promotion, writes _disibledevent=hash_max(maxnum)-hash_min(minnum);
del(maxnum,head);
del(minnum,head);
}
printf("%I64d\n",res);
}
刚开始接触线段树,还不会离散化~继续学习。
Tags:  比例线段 认识线段

延伸阅读

最新评论

发表评论