Open CTP314 opened 5 years ago
https://ctp314.github.io/2019/07/02/NOI2018-%E4%BD%A0%E7%9A%84%E5%90%8D%E5%AD%97/#more
P4770 [NOI2018]你的名字 求一个字符串的连续非空子串与询问串本质不同的非公共子串个数 一开始没看到本质不同,第二个下发数据完全不一致才发现 如果我们要求一个字符串的本质不同子串个数,那么我们只需要对于 $Parent$ 树上的每一个节点 $x$ 累计求和 $maxlen(x)-maxlen(parent(x))$ 现在,又多了一个字符串,导致每个节点产生和原来不一致的贡献,考虑每个
orzlch
https://ctp314.github.io/2019/07/02/NOI2018-%E4%BD%A0%E7%9A%84%E5%90%8D%E5%AD%97/#more
P4770 [NOI2018]你的名字 求一个字符串的连续非空子串与询问串本质不同的非公共子串个数 一开始没看到本质不同,第二个下发数据完全不一致才发现 如果我们要求一个字符串的本质不同子串个数,那么我们只需要对于 $Parent$ 树上的每一个节点 $x$ 累计求和 $maxlen(x)-maxlen(parent(x))$ 现在,又多了一个字符串,导致每个节点产生和原来不一致的贡献,考虑每个