/ Vijos / 题库 / 河流 /

题解

27 条题解

  • 0
    @ 2009-03-15 11:07:55

    我是f表示在i为根子树中建立j个伐木场,然后i下游最近的伐木场在i往下数第k个。

    我不是用背包,而是对每个i,j,k对儿子们用了二分。后来发现超时,又加了个类似线段树的记忆化-_-|||结果就ac了……

  • 0
    @ 2009-03-11 22:21:43

    成功地把这题AC率降低25个百分点

  • 0
    @ 2009-03-10 18:49:20

    f表示以I为根结点,子树中建K个伐木场,在I上面最近的伐木场为K的最小费用,对于每个I,用背包解决。另外,如果不是像李永刚那么强的话,最好分是不是在I建伐木场两种情况讨论,这样方便一些

  • 0
    @ 2009-03-09 20:29:34

    ...

  • 0
    @ 2009-03-09 22:57:54

    这题难度也三啊?

  • 0
    @ 2009-03-09 12:24:28

    树形Dp即可。

    注意这里需用三维状态,否则会有后效性。

    提示:

    设立状态 f[from][to][k]表示以from为根的子树建立k个伐木场,且有一个祖先伐木场为to的最小费用。

  • -2
    @ 2015-10-05 15:01:50

    qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmmmmmmmmmmmmmmmmmqqqqqqqqqqqqqqqqqqqmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnnnnnnbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvggggggggggggghhhhhhhhhhhhhhhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjmnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn6666666666666666666666666666666666bnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

    bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b

    b
    b
    b
    b
    b
    b
    b

    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b

    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b
    b

    b
    b
    b
    b

信息

ID
1518
难度
4
分类
动态规划 | 树形DP 点击显示
标签
递交数
509
已通过
201
通过率
39%
被复制
3
上传者