写之前,先发表下感慨:好久没写题解了,也许是因为自己越来越急利了,也可以说是因为越来越懒了. A. Diverse Substring 直接找一找有没有相邻的两个不同的字符即可. B. Vasya and Books 分别记录书本摆放顺序$a[]$,取书顺序$b[]$,每本书的位置$pos[]$,每本书在不在书堆上$in[]$,书堆最顶端的书的位置$top$(因为用的是数组,元素位置是固定的). 然后,按照题意枚举输入的取书顺序$b[]$,同时记录答案$ans$,更新$top$即可. C. Va…
题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=5008 Description In this problem, you are given a string s and q queries. For each query, you should answer that when all distinct substrings of string s were sorted lexicographically, which one is…
LCP Array Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 90 Accepted Submission(s): 26 Problem Description Peter has a string s=s1s2...sn, let suffi=sisi+1...sn be the suffix start with i…
Problem Description In this problem, you are given a string s and q queries. For each query, you should answer that when all distinct substrings of string s were sorted lexicographically, which one is the k-th smallest. A substring si...j of the str…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5635 LCP Array Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 282 Accepted Submission(s): 79 Problem Description Peter has a string s=s1s2..…
E. Misha and LCP on Tree Problem's Link Mean: 给出一棵树,每个结点上有一个字母.每个询问给出两个路径,问这两个路径的串的最长公共前缀. analyse: 做法:树链剖分+后缀数组. 记录每条链的串,正反都需要标记,组成一个长串. 然后记录每条链对应的串在大串中的位置,对大串求后缀数组,最后询问就是在一些链上的查询. Time complexity: O(n*logn) view code )); ); ; ; ; ; ) ; …
LCP Array Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 830 Accepted Submission(s): 232 Problem Description Peter has a string s=s1s2...sn, let suffi=sisi+1...sn be the suffix start with …
LCP Array Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 358 Accepted Submission(s): 102 Problem Description Peter has a string s=s1s2...sn, let suffi=sisi+1...sn be the suffix start with …
后缀数组+RMQ+二分 后缀数组二分确定第K不同子串的位置 , 二分LCP确定可选的区间范围 , RMQ求范围内最小的sa Boring String Problem Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 661 Accepted Submission(s): 183 Problem Description In thi…
Gson解析JSON字符串时出现了下面的错误: No-args constructor for class X does not exist. Register an InstanceCreator with Gson for this type to fix this problem. 解决的办法是把对应的Class改成静态类.…
I joined the NodeJS online Course three weeks ago, but now I'm late about 2 weeks. I pay the codeschool yearly subscribed, but I have lost the track long time. I get more weight than expected. I like more and more my MacBook Pro I maybe go to the UST…
Programming Contest Problem Types Hal Burch conducted an analysis over spring break of 1999 and made an amazing discovery: there are only 16 types of programming contest problems! Furthermore, the top several comprise almost 80% of the problems s…
You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. You need to determine whether it is possible to measure exactly z litres using these two jugs. If z liters of water is measurable, you must…
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are given the locations and height of all the buildings as shown on a cityscape photo (Figure A), write a pr…