题意:给定一个序列,求给定区间的第 k 小的值。 析:就是一个主席树的裸板。 代码如下: ...
分类:
其他好文 时间:
2017-05-04 00:05:14
阅读次数:
204
Kth number Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10682 Accepted Submission(s): 3268 P ...
分类:
其他好文 时间:
2017-05-02 10:10:44
阅读次数:
150
Description Give you a sequence and ask you the kth big number of a inteval. Solution 主席树模板题 敲完辣,心情瞬间变好,我要下楼看运动会 ...
分类:
其他好文 时间:
2017-04-27 17:57:17
阅读次数:
170
题目描述: 给定一颗二叉搜索树,请找出其中的第k大的结点。例如, 5 / \ 3 7 /\ /\ 2 4 6 8 中,按结点数值大小顺序第三个结点的值为4。 中序遍历 ...
分类:
其他好文 时间:
2017-04-26 13:09:43
阅读次数:
161
DescriptionGiven a big sorted array with positive integers sorted by ascending order. The array is so big so that you can not get the length of the wh ...
分类:
其他好文 时间:
2017-04-24 10:04:20
阅读次数:
131
Android -- Audio Native服务之启动流程分析(一)
Android中的Audio系统是比较庞大、繁杂的一部分内容, 其中会涉及较多的音频编解码、多媒体制式与Android Au...
分类:
移动开发 时间:
2017-04-22 17:37:07
阅读次数:
1176
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algorithm to us ...
分类:
其他好文 时间:
2017-04-18 18:24:01
阅读次数:
173
首先离线建出两棵树,对树$B$中每个点预处理出其往上$2^k$步的父亲以及中间的串的Hash值。 通过这个可以在$O(\log n)$的时间内比较两个串的字典序,以此将它们按字典序排序。 然后将树$A$压缩成Trie,并求出根到每个点的Hash值,同时预处理出每个串在$B$数组中出现的区间。 具体的 ...
分类:
其他好文 时间:
2017-04-14 10:02:21
阅读次数:
265