Sum of Series
CodeChefOpen on judge ↗
Given a function f(x) = anxn + an-1xn-1 + .... + a1x1 + a0, find SUMx=0x=m f(x) mod 1009 (a prime number) for given n and m. Input First line contains two space separated integers n and m. Next line contains n+1 space separated integers (each non negative and less than 100) which are the co-efficients an, an-1, ... , a0. 0 Output Output a single integer which is the sum mod 1009. Example In
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start