关于平方和

学术版

Green_Leaves @ 2024-11-29 16:43:37

区间加法的情况下可以做log的区间平方和吗?


by 0x3F @ 2024-11-29 16:49:55

@Green_Leaves 1


by bsdsdb @ 2024-11-29 16:49:58

@Green_Leaves 推个式子先


by bsdsdb @ 2024-11-29 16:51:37

\begin{aligned} &\sum(a_i+k)^2\\ =&\sum a_i^2+k^2+2ka_i\\ =&\sum a_i^2+\mathrm{cnt}k^2+2k^2\sum a_i \end{aligned}

|