Quasi-Polynomial Sum
You are given a polynomial P(X) = CD * XD + ... + C1 * X + C0 with integer coefficients C0, C1, ..., CD. You are also given a non-negative integer Q and positive integers M and N. Your task is to find the following sum (P(0) * Q0 + P(1) * Q1 + ... + P(N − 1) * QN − 1) mod M. Here A mod B means the remainder of the division of A by B. Usually polynomials are given by the sequence of the
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