At first look this problem seems very easy,But it is very tough to get Acc with the
formula given in problem statement (At least for lots of people, i submitted a number of time using data type int/long long/double but couldn't get Acc ).So the best way is to use
Horner's rule (I got Acc at first try)

. Here is the Horner's rule-
- Code: Select all
a_nx^n+a_(n-1)x^(n-1)+...+a_0=((a_nx+a_(n-1))x+...)x+a_0.
I think the stupid(not always

) pow() function is responsible for this.