Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Блог пользователя vatsal

Автор vatsal, история, 8 лет назад, По-английски

I have read Horner's rule for polynomial evaluation which does the work for O(n) where n is the degree of polynomial. Example: Let's take a polynomial of degree 3 -> 3x^3+ x^2 + 9 We are given many value of 'x' and a coefficient vector like [3,1,0,9] and let's take 'x' take to be 3 then it will be evaluated as 3*3^3 + 3^2 + 9 = 81+9+9 = 99 so the answer will be 99. Let's say we have q queries so Horner's rule will take O(nq). Is there any better algorithm? I have heard about FFT and DFT and I have consulted many resources but all in vain. Can anyone help me to understand it please?

  • Проголосовать: нравится
  • -20
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Indirectly You are asking for help for a live contest question : https://www.codechef.com/JULY16/problems/POLYEVAL

»
8 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

What a coincidence, I am solving the same problem on Codechef right now!