https://ac.nowcoder.com/acm/contest/881/B
https://www.cnblogs.com/zaq19970105/p/11210030.html

试图改写多项式:

\[\frac{1}{\prod_{i=1}^{n}a_i^2+x^2}\]

这个多项式用待定系数法设为:

\[\frac{1}{\prod_{i=1}^{n}a_i^2+x^2}=\sum_{i=1}^{n}\frac{c_i}{a_i^2+x^2}\]

其中 \(c_i\) 是常数(不太理解),先求解 \(c_1\) ,则把 \(a_1^2+x^2\) 乘到等式两边。

\[(a_1^2+x^2)\frac{1}{\prod_{i=1}^{n}a_i^2+x^2}=c_1+(a_1^2+x^2)\sum_{i=2}^{n}\frac{c_i}{a_i^2+x^2}\]

这个是恒等式,那么假设给他赋特殊值,把右侧消去 \((x^2=-a_1^2)\) (或者直接裂项)。

\[\frac{1}{\prod_{i=2}^{n}a_i^2-a_1^2}=c_1\]

类似地可以得到:

\[\frac{1}{\prod_{j!=i}a_i^2-a_1^2}=c_i\]

这个可以 \(O(n)\) 求出来。

所以原式为(配个微分,或者用只有1项的规律)

\[\sum_{i=1}^{n}\frac{c_i}{a_i^2+x^2}=\sum_{i=1}^{n}\frac{c_i}{2a_i}\pi\]

2019牛客暑期多校训练营(第一场) - B - Integration - 数学的更多相关文章

  1. 2019牛客暑期多校训练营(第二场) H-Second Large Rectangle(单调栈)

    题意:给出由01组成的矩阵,求求全是1的次大子矩阵. 思路: 单调栈 全是1的最大子矩阵的变形,不能直接把所有的面积存起来然后排序取第二大的,因为次大子矩阵可能在最大子矩阵里面,比如: 1 0 0 1 ...

  2. 2019牛客暑期多校训练营(第九场) D Knapsack Cryptosystem

    题目 题意: 给你n(最大36)个数,让你从这n个数里面找出来一些数,使这些数的和等于s(题目输入),用到的数输出1,没有用到的数输出0 例如:3  4 2 3 4 输出:0 0 1 题解: 认真想一 ...

  3. 2019牛客暑期多校训练营(第五场)G - subsequeue 1 (一题我真的不会的题)

    layout: post title: 2019牛客暑期多校训练营(第五场)G - subsequeue 1 (一题我真的不会的题) author: "luowentaoaa" c ...

  4. 2019牛客暑期多校训练营(第一场)A Equivalent Prefixes(单调栈/二分+分治)

    链接:https://ac.nowcoder.com/acm/contest/881/A来源:牛客网 Two arrays u and v each with m distinct elements ...

  5. 2019牛客暑期多校训练营(第一场)A题【单调栈】(补题)

    链接:https://ac.nowcoder.com/acm/contest/881/A来源:牛客网 题目描述 Two arrays u and v each with m distinct elem ...

  6. 2019牛客暑期多校训练营(第一场) B Integration (数学)

    链接:https://ac.nowcoder.com/acm/contest/881/B 来源:牛客网 Integration 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 5242 ...

  7. 2019牛客暑期多校训练营(第一场) A Equivalent Prefixes ( st 表 + 二分+分治)

    链接:https://ac.nowcoder.com/acm/contest/881/A 来源:牛客网 Equivalent Prefixes 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/ ...

  8. 2019牛客暑期多校训练营(第二场)F.Partition problem

    链接:https://ac.nowcoder.com/acm/contest/882/F来源:牛客网 Given 2N people, you need to assign each of them ...

  9. 2019牛客暑期多校训练营(第九场)A:Power of Fibonacci(斐波拉契幂次和)

    题意:求Σfi^m%p. zoj上p是1e9+7,牛客是1e9:  对于这两个,分别有不同的做法. 前者利用公式,公式里面有sqrt(5),我们只需要二次剩余求即可.     后者mod=1e9,5才 ...

  10. 2019牛客暑期多校训练营(第八场)E.Explorer

    链接:https://ac.nowcoder.com/acm/contest/888/E来源:牛客网 Gromah and LZR have entered the fifth level. Unli ...

随机推荐

  1. sqli-5&6

    第五关 Double Injection - Single Quotes - String (双注入GET单引号字符型注入) 1.发现前几关的方法都不能用了,要么报错(没有其他有关信息.要么什么也不出 ...

  2. Lamabda Where Select Find First等区别

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cons ...

  3. Express 中配置使用 art-template模板引擎

    art-template 官网 https://aui.github.io/art-template/ 安装: npm install --save art-template npm install ...

  4. Flutter-SearchDelegate搜索框

    搜索欄 import 'package:flutter/material.dart'; typedef SearchItemCall = void Function(String item); cla ...

  5. LSTM 神经网络输入输出层

    今天终于弄明白,TensorFlow和Keras中LSTM神经网络的输入输出层到底应该怎么设置和连接了.写个备忘. https://machinelearningmastery.com/how-to- ...

  6. Java缓冲流写出数据实例

    public class BufferedWriterDemo throws IOException { public static void main(String[] args) throws I ...

  7. kwargs - Key words arguments in python function

    This is a tutorial of how to use *args and **kwargs For defining the default value of arguments that ...

  8. Centos7防火墙和SELinux的开启和关闭

    在虚拟机里面开启多个服务,对应多个端口,在防火墙开启的情况下,就要对外开放端口,这样客户端才能正常访问,但比较繁琐,关闭更直接点. 防火墙 临时关闭防火墙 systemctl stop firewal ...

  9. 【Go】Go语言的%d,%p,%v等占位符的使用

    golang 的fmt 包实现了格式化I/O函数,类似于C的 printf 和 scanf. # 定义示例类型和变量 type Human struct { Name string } var peo ...

  10. js中元素更新value页面体现不出来的原因

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...