Let be a vector of integer numbers that contains the coefficients of a polynomial of degree . For instance, the vector represents , a polynomial of degree .
Write a function
int evaluate(const vector<int>& p, int x);
that evaluates the polynomial at the point @x@, that is, that returns .
Use the Horner scheme:
You only need to submit the required procedure; your main program will be ignored.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T11:01:05.234Z
© Jutge.org, 2006–2026.
https://jutge.org