I have a doubt in evaluating function

i have a doubt in evaluating function

here is the code i used boost library but still i am getting WA
Coding Blocks IDE

Hello @sunneykumar309 what is the question that you are doing?

Alice is learning mathematical functions. In his assignment, teacher has asked him to evaluate h(x)= f(x)+g(x) where
f(x)=3x2-x+10 and
g(x)=4x3+2x2-5x+4.
As he is weak in mathematics, help him finish this task.

Hint: Since X is large, you need to work with Big Integers!

Input Format

Single line containing an integral value denoting the value of x.

https://online.codingblocks.com/app/player/151917/content/169698/5109/code-challenge

Hello @sunneykumar309 as the test cases are larger then you have to perform operations on it in the form of string.
your approach will not work for all test cases.

sorry but i am confused .what are you saying?

it passes for 4/5 test cases

Here as you can see x can be as large as 10 raise to the power 50.

this means that x will containg 50 digits if that will the case and even long long int can take input for the digit with atmost 18digits only.

it will pass that test case which have x is only small.

is it ok to use boost librrary

Hello @sunneykumar309 i think the method you are thinking is right.but it wouldn’t work because hackerblocks has no option for c++17.
you have to use the string method only.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.