多项式求逆

解决问题类型

\[f(x)\times g(x)\equiv 1\pmod {x^n} \]

已知 \(f(x)\),求 \(g(x)\)

推导

\[f(x)\times g_0(x)\equiv1\pmod {x^{\lceil \frac{n}{2} \rceil}} \]

\[f^2(x)\times {g_0}^2(x)-2f(x)\times g_0(x)+1\equiv 0\pmod {x^n} \]

\[1\equiv 2f(x)\times g_0(x)-f^2(x)\times {g_0}^2(x)\pmod {x^n} \]

\[g(x)\equiv 2\times g_0(x)-f(x)\times {g_0}^2(x)\pmod {x^n} \]

模板代码

\(\to\)

应用

[集训队作业2013]城市规划

Solution

posted @ 2020-12-28 21:59  zjjws  阅读(79)  评论(0编辑  收藏  举报