Can anyone help me what is wrong with my code
question line -
my submission link -
https://www.codechef.com/viewsolution/60649808
please help me asap…
Can anyone help me what is wrong with my code
question line -
my submission link -
https://www.codechef.com/viewsolution/60649808
please help me asap…
Hey, the problem in your code is that you have applied ceil on (a[i]/2), which is an integer, so basically what is happening is that first the division occurs and it returns the integers value(removing everything after the decimal), and then the rounded value is being passed to ceil.
Instead if you typecast the values to double or long double before dividing, it will work.
Look at the code here, I have added long double before a[i] and it passed ![]()
oh! thanks …now i got my mistake