摘要: CF995F Cowmpany Cowmpensation Solution ~~这道题目可以看出我的代码能力是有多渣(代码能力严重退化)~~ 我们先考虑dp,很容易写出方程: 设$f_{i,j}$表示以$i$为根的子树中$i$的值为$j$,那么转移为: $$ \begin{aligned} f_{ 阅读全文
posted @ 2019-01-29 15:32 QwQGJH 阅读(183) 评论(0) 推荐(0) 编辑
摘要: BZOJ4827 [Hnoi2017]礼物 Solution 如果一串数的增加,不就等于另一串数减吗? 那么我们可以把答案写成另一个形式: $ans=\sum_{i=1}^n(x_i y_i+C)^2$ $y$可以是重新排列 那么疯狂拆一下式子,化简之后就是: $ans=\sum_{i=1}^nx_ 阅读全文
posted @ 2019-01-29 11:08 QwQGJH 阅读(130) 评论(0) 推荐(0) 编辑
摘要: HDU5730 Shell Necklace 题目大意 已知连续i(1 include include include include include include include include using namespace std; define ll long long define re 阅读全文
posted @ 2019-01-29 09:54 QwQGJH 阅读(144) 评论(0) 推荐(0) 编辑