zoukankan      html  css  js  c++  java
  • [LOJ6569] 仙人掌计数

    Statement

    带标号仙人掌计数问题.((n le 131071)

    Solution

    (x)个点的仙人掌个数的生成函数为(C(x))

    • 对于与根相邻的块, 还是仙人掌, 生成函数为(C(x))

    • 包含根的环, 生成函数为(sum_{i ge 2}frac{C(x)^i}{2})

    组合起来:

    [C(x) = x exp{frac{2C(x)-C(x)^2}{2-2C(x)}} ]

    (G(C(x)) = xexp{frac{2C(x)-C(x)^2}{2-2C(x)}}-C(x)), 那么:

    [small{ egin{aligned} G'(C(x)) &= xleft(exp{frac{2C(x)-C(x)^2}{2-2C(x)}} ight)'-1 \ &= x expleft(frac{2C(x)-C(x)^2}{2-2C(x)} ight)left(frac{2C(x)-C(x)^2}{2-2C(x)} ight)' - 1 \ &= x expleft(frac{2C(x)-C(x)^2}{2-2C(x)} ight) left(frac{left(2-2C(x) ight)^2-left(2C(x) - C(x)^2 ight)(-2)}{(2-2C(x))^2} ight) - 1\ &= x expleft(frac{2C(x)-C(x)^2}{2-2C(x)} ight) left(1+frac{4C(x) - 2C(x)^2}{(2-2C(x))^2} ight) - 1 end{aligned} } ]

    牛顿迭代:

    [egin{aligned} C_1(x) &= C(x) - frac{G(C(x))}{G'(C(x))} \ &= C(x) - frac{2xexpleft(frac{2C(x)-C(x)^2}{2-2C(x)} ight)-2C(x)} {x expleft(frac{2C(x)-C(x)^2}{2-2C(x)} ight) left(1+frac{1}{(C(x)-1)^2} ight) - 2} end{aligned} ]

    Code

    https://loj.ac/submission/358148

  • 相关阅读:
    造数据
    自定义注解
    利用线程池,同步线程实现并发
    ThreadPoolExecutor 线程池
    velocity 模板
    [python] 解析xml文件
    url 中需要转义的字符
    Appium 坑
    TestNG 101
    【python】print · sys.stdout · sys.stderr
  • 原文地址:https://www.cnblogs.com/Hany01/p/count-cactuses.html
Copyright © 2011-2022 走看看