太弱了。。挖坑。。
设当前分治的根为root。d[i]表示i到root的距离,dep[i]表示i到root的深度,f[i]表示到root的路径为i需要的最小边数,tag[i]表示是否存在从一个点到root的路径为i(这样可以重复利用f数组)。枚举root的子节点v,第一个v用来更新tag数组和f数组,对于后面的v,先更新答案,然后更新tag和f数组即可。
方法同上。(注意K可能是0,极坑)
貌似有O(n)的treedp我不会太弱QUQ。点分即可。记录%3=0.1.2的个数,乘一下就好。
边分好了。每次得到两个字树的答案,维护一个大根堆每次把大的插进答案堆。答案堆是个小根堆。
2021年9月13日 18:56
Awesome article! I want people to know just how good this information is in your article. It’s interesting, compelling content. Your views are much like my own concerning this subject. soap2day
2021年9月15日 16:53 Thanks for taking the time to discuss this, I feel strongly that love and read more on this topic. If possible, such as gain knowledge, would you mind updating your blog with additional information? It is very useful for me. best CBD salves
2021年9月15日 19:12
Hi, I find reading this article a joy. It is extremely helpful and interesting and very much looking forward to reading more of your work.. 123movies
2021年10月01日 19:29
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. browse around this website
2021年10月02日 21:38
Be careful while buying a chair for back pain. Here we suggest you best ergonomic chair for watching TV. These are highly recommended chairs. Chose a chair and get rid of your back pain.
2021年10月10日 00:23
Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. SEO เว็บพนัน
2021年10月30日 23:22 Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks bosbandarq