Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int evaluate(std::vector<int> v, int x){
- int sum = 0;
- std::reverse(v.begin(),v.end());
- for(int& i: v){
- sum = sum*x+i;
- }
- return sum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement