https://www.luogu.com.cn/problem/P3647 https://oj.uz/problem/view/APIO14_beads 无根树不太好设计状态,想办法转成有根树,然后用子树替换大法。 再跑换根 dp。 我永远爱宏。 #include using namespace lastweapon; const int N = int(2e5) + 9; int d[N][…
https://www.luogu.com.cn/problem/P3647 https://oj.uz/problem/view/APIO14_beads 无根树不太好设计状态,想办法转成有根树,然后用子树替换大法。 再跑换根 dp。 我永远爱宏。 #include using namespace lastweapon; const int N = int(2e5) + 9; int d[N][…
讨论
登录后参与讨论
还没有评论,来说第一句吧。