hdu 2665 Kth number (函数式线段树)+ SPOJ Count on a tree
划分树解法可以参考: http://blog.csdn.net/freezuoguan/article/details/8490643
链接: http://acm.hdu.edu.cn/showproblem.php?pid=2665
题意:求区间第K大的数:
朴素的想法是:首先离散化数列,对于数列的所有前缀都建立一棵线段树,以b[i]为根, 线段树[ l, r ] 存的是符合
原创
2013-03-27 17:09:41 ·
2057 阅读 ·
0 评论