How to solve This problem using FFT ?

Revision en2, by darkworld1, 2020-07-22 13:55:50

Recently I tried to solve the problem Unmerge using FFT.
After making the block array try to compute this polynomial (x^a1+1)(x^a2+1).....(x^am +1) using divide and conquer but I am getting TLE. but my complexity is n(log(n))^2. Here is my solution
please help me to optimize my solution.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English darkworld1 2020-07-22 13:55:50 4 Tiny change: 'ty is n(long)^2. Here ' -> 'ty is n(log(n))^2. Here '
en1 English darkworld1 2020-07-22 13:55:07 442 Initial revision (published)