Victor and String Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/262144 K (Java/Others) Total Submission(s): 163 Accepted Submission(s): 78 Problem Description Victor loves to play with string. He thinks a string is charming as the…
Sample Input 6 1 a 1 b 2 a 2 c 3 4 8 1 a 2 a 2 a 1 a 3 1 b 3 4 Sample Output 4 5 4 5 11 题意:多组输入,开始字符串为空,支持4中操作: 1,在字符串首加字符: 2,在字符串尾加字符: 3,查询字符串不同本质的回文串个数: 4,查询回文串个数总和 思路:因为支持首尾加入,所以和常规的回文树有些不同. 参考了YYB的博客. 发现首尾互相影响,当且仅当整个字符串是回文串. 其他情况两头正常加即可. #include…
Harry and magic string Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 223 Accepted Submission(s): 110 Problem Description Harry got a string T, he wanted to know the number of T's disjoint…
题目链接:https://nanti.jisuanke.com/t/41389 The value of a string sss is equal to the number of different letters which appear in this string. Your task is to calculate the total value of all the palindrome substring. Input The input consists of a single…
The Problem to Slow Down You Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93645#problem/G Description http://7xjob4.com1.z0.glb.clouddn.com/76e435d3c21fa3cbeef1e76780086dc4 Input Output Sample In…
CA loves strings, especially loves the palindrome strings. One day he gets a string, he wants to know how many palindromic substrings in the substring S[l,r] . Attantion, each same palindromic substring can only be counted once. InputFirst line conta…
A string is palindrome, if the string reads the same backward and forward. For example, strings like "a", "aa", "appa", "queryreuq" are all palindromes. For given empty string S, you should process following two que…
19.32% 1000ms 256000K A number is skr, if and only if it's unchanged after being reversed. For example, "12321", "11" and "1" are skr numbers, but "123", "221" are not. FYW has a string of numbers, each su…
Palindromic Substring Time Limit: 10 Seconds Memory Limit: 65536 KB In the kingdom of string, people like palindromic strings very much. They like only palindromic strings and dislike all other strings. There is a unified formula to calculate th…
CA Loves Palindromic Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 301 Accepted Submission(s): 131 Problem Description CA loves strings, especially loves the palindrome strings. One day…