Polynomial problem?

Правка en2, от i_love_sqrt_decomp, 2025-07-29 05:16:59

I just did a problem that asks you for $$$q$$$ queries of $$$[x^k](\prod_{i=1}^{n}(1+x^i))^2\ mod \ 10^9 + 7$$$. $$$n$$$ is given beforehand and $$$k$$$ is given in the queries. Constraints: $$$n,k,q \leq 10^5$$$. Is there a simple solution that doesn't involve a huge polynomials template that runs in $$$o(NK)$$$? (The time limit is 3 seconds).

My approach

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский i_love_sqrt_decomp 2025-07-29 05:16:59 19 Tiny change: '2\ mod \ 1^9 + 7$. $' -> '2\ mod \ 10^9 + 7$. $'
en1 Английский i_love_sqrt_decomp 2025-07-29 05:15:33 653 Initial revision (published)