
拉格朗日插值
coldfresh
那我们开始吧
展开
-
【CodeForces - 622F 】The Sum of the k-th Powers (拉格朗日插值)
Examples Input 4 1 Output 10 Input 4 2 Output 30 Input 4 3 Output 100 Input 4 0 Output 4 这个就直接上我的模板就可以了.#include<iostream>#include<cstdio>#include<cmath>#defi...原创 2018-08-21 15:32:01 · 426 阅读 · 0 评论 -
求解n次函数多项式之拉格朗日插值
设F(x)=a0+a1x+a2x2+...+anxnF(x)=a0+a1x+a2x2+...+anxnF(x)=a_0+a_1x+a_2x^2+...+a_nx^n在一些题目中例如找规律,比如是我上次在区域赛的时候如果可以真名或者猜出一些式子是多项式,还有次数,那么我用的待定系数法,就可以解方程来做了。 可以直接手动解,但是也可以借助程序了。 这里就用到了一个东西叫拉格朗日插值法。 假如...原创 2018-08-21 10:44:15 · 7373 阅读 · 0 评论 -
【HDU 6607】Easy Math Problem(杜教筛+min25筛+拉格朗日插值)
Problem DescriptionOne day, Touma Kazusa encountered a easy math problem. Given n and k, she need to calculate the following sum modulo 1e9+7.∑i=1n∑j=1ngcd(i,j)klcm(i,j)[gcd(i,j)∈prime]%(1e9+7)∑_{i=...原创 2019-08-06 22:12:00 · 549 阅读 · 0 评论