I know that this problem supposed to be a trivial problem , but I stay in it about 1 hour and i don't know why it get WA on test 3 about 10 times of submissions and i submitted the solution with python and c++ as i thought that WA is due to precision error but both of them didn't get accepted.
Any help please?
c++ code
python code
It is about rounding, you have to set value = (dist * 1000.0) / (331.3 + .606 * temp), and then to round you have to floor(value*100+0.5)/100; Then it gets AC.
thank you, my code get accepted in python and c++ also.
This still gives me wrong answer. What am I doing wrong?
You don't use setprecision after rounding, due to it changing the answer. It gets AC when you remove fixed and setprecision(2).
Thank you :)
your code will be accepted if you print value without setprecision and fixed, but i don't know why these happened.