https://nanti.jisuanke.com/t/30998 题意 给一串由0..9组成的数字字符串,求所有不同回文串的权值和.比如说“1121”这个串中有“1”,“2”,“11”,“121”三种回文串,他们的权值分别是1,2,11,121.最终输出ans=135. 分析 第一次知道马拉车是manacher...涨姿势了 在马拉车进行的过程中,进行子回文串的统计去重. 这里的哈希去重方法重点学习理解. #include <iostream> #include <cstdio>…
题意 https://nanti.jisuanke.com/t/A1955 求所有本质不同的回文串转成数后的和. 思路 如果了解回文树的构造原理,那么这题就很简单了,回文树每个结点代表一个回文串,每添加一个字符会在两端加上这个字符,我们只需要用res[]数组表示原串的前缀和,然后每添加一个字符的贡献就是res[i]-res[i-len[c]]*10^(len[c]) ,i为这个字符的下标.c为字符,我们累加贡献即可.还是挺简单的,但不晓得当时为什么过的人不是很多.. 代码 #include<bi…
A square-free integer is an integer which is indivisible by any square number except 11. For example, 6 = 2 \cdot 36=2⋅3 is square-free, but 12 = 2^2 \cdot 312=22⋅3 is not, because 2^222 is a square number. Some integers could be decomposed into prod…
ACM-ICPC 2018 南京赛区网络预赛 E题 题目链接: https://nanti.jisuanke.com/t/30994 Dlsj is competing in a contest with n (0 < n \le 20)n(0<n≤20) problems. And he knows the answer of all of these problems. However, he can submit ii-th problem if and only if he has s…
题目链接:https://nanti.jisuanke.com/t/30991 Feeling hungry, a cute hamster decides to order some take-away food (like fried chicken for only 3030 Yuan). However, his owner CXY thinks that take-away food is unhealthy and expensive. So she demands her hams…
J. Sum 26.87% 1000ms 512000K   A square-free integer is an integer which is indivisible by any square number except 11. For example, 6 = 2 \cdot 36=2⋅3 is square-free, but 12 = 2^2 \cdot 312=22⋅3 is not, because 2^222 is a square number. Some integer…
G. Lpl and Energy-saving Lamps 42.07% 1000ms 65536K   During tea-drinking, princess, amongst other things, asked why has such a good-natured and cute Dragon imprisoned Lpl in the Castle? Dragon smiled enigmatically and answered that it is a big secre…
A. An Olympian Math Problem 54.28% 1000ms 65536K   Alice, a student of grade 66, is thinking about an Olympian Math problem, but she feels so despair that she cries. And her classmate, Bob, has no idea about the problem. Thus he wants you to help him…
题目链接:https://nanti.jisuanke.com/t/30991 2000ms 262144K   Feeling hungry, a cute hamster decides to order some take-away food (like fried chicken for only 3030 Yuan). However, his owner CXY thinks that take-away food is unhealthy and expensive. So she…
轻轻松松也能拿到区域赛名额,CCPC真的好难 An Olympian Math Problem 问答 只看题面 54.76% 1000ms 65536K   Alice, a student of grade 66, is thinking about an Olympian Math problem, but she feels so despair that she cries. And her classmate, Bob, has no idea about the problem. T…