hdu 3553 Just a String (后缀数组) 题意:很简单,问一个字符串的第k大的子串是谁. 解题思路:后缀数组.先预处理一遍,把能算的都算出来.将后缀按sa排序,假如我们知道答案在那个区间范围内了(假设为[l,r]),那么我们算下这个区间内的lcp的最小值(设最小值的位置为mid,大小为x),如果x*(r-l+1)>=k,那么,答案就是这个区间的lcp的最小值的某一部分(具体是哪一部分,画个图稍微算下就出来了).如果x * ( r - l + 1 ) < k 那么我们分两种情况…
Problem Description Recently, doge starts to get interested in a strange problem: whether there exists a string A following all the rules below: 1.The length of the string A is N . 2.The string A contains only lowercase English alphabet letters. 3.Ea…
Lweb and String 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5842 Description Lweb has a string S. Oneday, he decided to transform this string to a new sequence. You need help him determine this transformation to get a sequence which has the longe…
题目链接: D. Recover the String time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output For each string s consisting of characters '0' and '1' one can define four integers a00, a01, a10 and a11, where …
Count the string Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 8845 Accepted Submission(s): 4104 Problem Description It is well known that AekdyCoin is good at string problems as well as n…
Lweb and String 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5842 Description Lweb has a string S. Oneday, he decided to transform this string to a new sequence. You need help him determine this transformation to get a sequence which has the longe…
Wow! Such Sequence! 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4893 Description Recently, Doge got a funny birthday present from his new friend, Protein Tiger from St. Beeze College. No, not cactuses. It's a mysterious blackbox. After some resea…
Problem Description Chen, Adrian (November 7, 2013). "Doge Is An Ac- tually Good Internet Meme. Wow.". Gawker. Retrieved November 22, 2013. Doge is an Internet meme that became popular in 2013. The meme typically con- sists of a picture of a Shi…
磨了一天的线段树,不能说完全搞清楚,只能说有一个大概的了解,靠着模板才把这道题A了,只能说太弱~~! 题意: 初始时有一字符串,全为0. 三种操作: 1 k d - add 把d加到第k个数上去2 l r - query sum 计算l到r所有数的和3 l r - change to nearest Fibonacci 把l到r的数修改为距离它最近的斐波那契数 节点附件三个值: s1:由lazy控制的区间的正确的和. s2:区间内与所有数相近的fib数之和,随着单点更新而更新. col:laz…
http://acm.hdu.edu.cn/showproblem.php?pid=4893 三种操作: 1 k d - "add" 2 l r - "query sum" 3 l r - "change to nearest Fibonacci" 节点附件三个值: s1:由lazy控制的区间的正确的和. s2:区间内与全部数相近的fib数之和,随着单点更新而更新. col:lazy,标记区间是否所有取fib数,是取1,否则取0. 询问区间的和时…
String类创建对象的方法可以分为以下三种 1.String a = "123"; 2.String b = new String("123"); 3.String c = "12" + "3"; 1程序执行时,会先去jvm的常量池(在方法区中)中寻找有没有"123" 的String 对象,如果已经存在,则无须新建对象,直接把常量池中的对象地址返回给栈中的引用 a (此时没有建立对象) 如果没有存在,则在…
B. Recover the String 题目连接: http://www.codeforces.com/contest/708/problem/B Description For each string s consisting of characters '0' and '1' one can define four integers a00, a01, a10 and a11, where axy is the number of subsequences of length 2 of…
Wow! Such Sequence! Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2234 Accepted Submission(s): 657 Problem Description Recently, Doge got a funny birthday present from his new friend, Prot…
It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example: s: "abab" The prefixes are: "a", "ab&…
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11607 Accepted Submission(s): 5413Problem Description It is well known that AekdyCoin is good at string problems as well as number theory probl…
Victor and String Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on HDU. Original ID: 542164-bit integer IO format: %I64d Java class name: Main Victor loves to play with string. He thinks a string is charming as the string…