QOJ.ac

QOJ

Type: Editorial

Status: Open

Posted by: Qingyu

Posted at: 2026-01-28 02:28:15

Last updated: 2026-01-28 02:28:24

Back to Problem

题解 2

让我们快进到题解那个 BGF:

$$ [x^n y^m] \frac2{1-y+\sqrt{1-y}\sqrt{1-y-4x(1-x)}} $$

提出 $\frac1{1-y}$,

$$ [x^n y^m] \frac1{1-y}\frac2{1+\sqrt{1-\frac{4x(1-x)}{1-y}}} $$

注意到 $\frac2{1+\sqrt{1-4t}}$ 的系数是容易算的,那么我们只需要考虑计算

$$ \sum_{k\ge 0} \left([x^n y^m] \frac{x^k(1-x)^k}{(1-y)^{k+1}}\right)\left([t^k] \frac2{1+\sqrt{1-4t}}\right) $$

容易做到 $O(n)$。总复杂度 $O(qn)$。

Comments

No comments yet.