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 1550. Dean's Pyramid 3

HELP
Posted by Caesar_KZ 21 Apr 2007 13:59
The task is to find a volume of Piramid - volume of cylindr ? CAn you tell me the FORMULA?
Re: HELP
Posted by Kollekcioner2007 21 Jun 2007 02:29
It is very easy)))
    double res = sqr(w)*h/3-h*pi*sqr(r)*(w-2*fabs((((y >= x && y >= -x) || (y < x && y < -x)) ? y : x)))/w;
Re: HELP
Posted by Neizvestnii 21 Jun 2007 14:54
What procedure fabs does?
Re: HELP
Posted by Paul Diac 7 Sep 2007 22:38
abs (absolute value) for float.
Re: HELP
Posted by Paul Diac 7 Sep 2007 23:27
How can you solve it so easy?
Re: HELP
Posted by ArcSin 16 Oct 2007 21:56
Kollekcioner2007 wrote 21 June 2007 02:29
It is very easy)))
    double res = sqr(w)*h/3-h*pi*sqr(r)*(w-2*fabs((((y >= x && y >= -x) || (y < x && y < -x)) ? y : x)))/w;
Why is minus?   ..w-2*fabs..