相关链接
题目传送门:http://codeforces.com/contest/741/problem/D
中文题面:https://blog.sengxian.com/solutions/cf-741d
解题报告
看起来这个串的定义非常强的样子,但仔细观察不难发现,就是出现次数为奇数的字母最多出现一个
于是我们定时一个二进制状态$f_{i,j}$表示$i$到$j$这段路径中哪些字符出现了奇数次
我们考虑在每一条合法路径的LCA处将其统计
于是就变成了子树相关问题,于是非常自然想到启发式合并
考虑从子树最大的儿子那里继承集合,其他的儿子的集合暴力加入
因为走一条边,需要异或一个值,整个集合的转移我们可以记录一个标记,然后在插入时使其生效
考虑统计的话,我们在暴力插入的时候,枚举是哪一位不同,单次查询是$O(22)$的
又因为加入是$O(1)$的,所以总的时间复杂度$O(n \log n \cdot 22)$
好文章!666,学习了
Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I cant believe youre not more popular because you definitely have the gift.
562924 129057I truly enjoy examining on this website , it has good content . 574563
341140 598034This style is steller! You naturally know how to maintain a reader amused. Between your wit and your videos, I was almost moved to start my own blog (effectively, almostHaHa!) Amazing job. I really enjoyed what you had to say, and a lot more than that, how you presented it. Too cool! 10739
25296 604993I believe this really is very best for you: Soccer, Football, Highlight, Live Streaming 569535
272145 385577I take excellent pleasure in reading articles with quality content material. This write-up is one such writing that I can appreciate. Keep up the very good function. 417975
583442 892919Ill do this if require to as considerably as I hope that is not too far off the track. 647855
897594 766343Outstanding post, I conceive weblog owners really should acquire a lot from this weblog its very user pleasant. 226877
419123 579757Wow that was strange. I just wrote an incredibly long comment but after I clicked submit my comment didnt appear. Grrrr properly Im not writing all that more than once more. Regardless, just wanted to say great weblog! 894844
870091 203024I really like meeting utile info, this post has got me even more info! . 941433
761293 332239learning toys can enable your kids to develop their motor skills quite easily;; 258167
677350 641242Youre the top, It is posts like this that keep me coming back and checking this web site regularly, thanks for the information! 39492
826236 631924An incredibly fascinating go through, I might not concur entirely, however you do make some truly legitimate factors. 597490
Hi there! This is kind of off topic but I need some help from an established blog. Is it hard to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about making my own but I’m not sure where to start. Do you have any tips or suggestions? With thanks