ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1489. Points on a Parallelepiped

printf precision
Posted by []zhi (Bozhin Katsarski) 30 Dec 2013 02:20
My question is not particularly about this problem,
but about printf output with precision 10^-6 or better.

In this problem when I use float and output with printf("%.6f", ... ) I get WA8.
When I use double and printf("%.6lf", ... ) I get WA1.
What is the correct approach please?
Re: printf precision
Posted by []zhi (Bozhin Katsarski) 30 Dec 2013 02:30
I later got AC with this algorithm, it was correct as I had expected.
What I did was use double for the points' coordinates and output with ".6f" as if the were float.
Why does that work and my other version doesn't?