10434 - Working With Specific Gravity

All about problems in Volume 104. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
yoshiro aoki
New poster
Posts: 21
Joined: Sat Oct 21, 2006 11:50 pm
Contact:

10434 - Working With Specific Gravity

Post by yoshiro aoki »

The problem is not a big deal, but watch out that you use a good pi value.
I used 3.14159 from memory, but it was not good enough.

Pi is in math.h, and on MS compilers its ifdef'd out.
here it is: 3.14159265358979323846, u can borrow it :wink:

Maybe best to copy & paste it to a variable on such platforms as the required #define is not standard C++ & may give compile errors on the Judge.

good luck :)
yoshiro (mark) aoki
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Re: 10434: Working with Specific Gravity

Post by Jan »

yoshiro aoki wrote:Maybe best to copy & paste it to a variable on such platforms as the required #define is not standard C++ & may give compile errors on the Judge.
I dont understand what are you saying. You can use

Code: Select all

#define Pi (2*acos(0.0))
And this works perfectly. And there is one multiplication. So, you can store it in a variable.

Code: Select all

double pi = 2*acos(0.0);
You have to include math.h for the acos() function. Thats all.
Ami ekhono shopno dekhi...
HomePage
yoshiro aoki
New poster
Posts: 21
Joined: Sat Oct 21, 2006 11:50 pm
Contact:

Post by yoshiro aoki »

Im sorry that you cannot understand it, but I cannot make it more clear than what I have already said. :( I hope someone else may be able to help you.

have a good day
yoshiro (mark) aoki
Post Reply

Return to “Volume 104 (10400-10499)”