题意:给你一个长度为n的字符串和m组询问,每组询问给出l,r,k,求s[l,r]的第k次出现的左端点。 解法一: 求出后缀数组,按照排名建主席树,对于每组询问二分或倍增找出主席树上所对应的的左右端点,求第k大的下标即可。 解法二: 建立后缀自动机,对后缀树(fail树)作线段树合并可得到每个结点包含 ...
分类:
编程语言 时间:
2019-09-12 23:37:36
阅读次数:
144
You are given an array aa consisting of nn integers, and qq queries to it. ii th query is denoted by two integers lili and riri. For each query, you h ...
分类:
其他好文 时间:
2019-09-12 15:06:55
阅读次数:
85
Java中线程的状态定义在java.lang.Thread类中的一个枚举中。 1 public enum State { 2 /** 3 * Thread state for a thread which has not yet started. 4 */ 5 NEW, 6 7 /** 8 * Th ...
分类:
编程语言 时间:
2019-09-11 09:57:34
阅读次数:
67
https://www.luogu.org/problem/P2947 题目描述 Farmer John's N (1 <= N <= 100,000) cows, conveniently numbered 1..N, are once again standing in a row. Cow i ...
分类:
其他好文 时间:
2019-09-10 01:07:10
阅读次数:
101
题目描述 Farmer John has been having trouble making his plants grow, and needs your help to water them properly. You are given the locations of N raindrop ...
分类:
其他好文 时间:
2019-09-09 22:52:36
阅读次数:
104
On the first row, we write a 0. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence ...
分类:
其他好文 时间:
2019-09-09 22:48:45
阅读次数:
387
使用基于ListView的扩展组件ExpandableListView制作类似QQ好友的列表 这里会用到SimpleExpandableListAdapter这个适配器 首先看一下这个适配器的构造方法 / Constructor @param context The context where th ...
分类:
其他好文 时间:
2019-09-09 22:32:16
阅读次数:
107
如有乱码,请点击。 题目描述 Farmer John is herding his N cows (1 <= N <= 2,500) across the expanses of his farm when he finds himself blocked by a river. A single ...
分类:
其他好文 时间:
2019-09-08 09:57:46
阅读次数:
96
GC需要完成的三个件: 哪些内存需要回收 ?什么时候回收? 如何回收? java内存运行时区域中程序计数器,虚拟机栈,本地方法栈3个区域随线程而生,随线程而灭,栈中的栈帧随着方法的进入和退出 而有条不紊的执行着出栈和入栈操作。每一个桢帧中分配多少内存基本上是类结构确定下来就已知的,因此这个区域的内存 ...
分类:
其他好文 时间:
2019-09-07 13:11:22
阅读次数:
92
Markdown 学习记录 Markdown 简介 Markdown是一种轻量级标记语言,创始人为约翰·格鲁伯(英语:John Gruber)。它允许人们“使用易读易写的纯文本格式编写文档,然后转换成有效的XHTML(或者HTML)文档”。[4]这种语言吸收了很多在电子邮件中已有的纯文本标记的特性。 ...
分类:
其他好文 时间:
2019-09-06 01:03:27
阅读次数:
69