[UOJ # 450] [2018] Team work Repeater

Subject to the effect

\ (n-\) balls placed \ (K \) boxes, each box is the number of balls \ (D \) multiple of the number of programs seeking \ (% 998 244 353 \) values
subtask1 (5pts) : \ (D =. 1 \)
subtask2 (25pts): \ (n-\ Leq 10 ^. 3, K \ Leq 100 \)
subtask3 (30pts): \ (n-\ Leq 10 ^. 9, K \ Leq. 5 * 10 ^. 5 , D = 2 \)
subtask4 (40pts): \ (n-\ ^ Leq 10. 9, K \ ^ Leq 10. 3, D =. 3 \)

answer

\ (O (nk) \) Violence DP:
\ [!! F_ {I, J} * (X * D) -> F_ {I +. 1, J + X * D} ANS / = n-\]
can be written as \ (K \) th polynomial multiplying the same (except the last one and then \ (n-\)! ), write the generating function:
\ [\ sum_ {I} = 0 ^ \ infty \ FRAC {I} {! X} ^ i \]

Guess you like

Origin www.cnblogs.com/zzqtxdy/p/12043756.html