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 1633. Hippogriffs

why WA10?
Posted by Iliya (Java) 11 Oct 2008 15:34
I find maximum of the maximal influence of elixir by formula:
Math.sqrt((b1 * b1 + b2 * b2 + a1 * a1 + a2 * a2 +Math.sqrt(a1 * a1 * a1 * a1 + a2 * a2 * a2 * a2 + 8 * a1 * a2 * b1 * b2 - 2 * a2 * a2 * (b1 * b1 - b2 * b2) + 2 * a1 * a1 * (a2 * a2 + b1 * b1 - b2 * b2) + (b1 * b1 + b2 * b2) * (b1 * b1 + b2 * b2))) / 2)

...and get wa. What's wrong?
Re: why WA10?
Posted by Aisenshtein Daniil 11 Oct 2008 15:41
sorry, too many letters
P.S. No comments
Re: why WA10?
Posted by Giorgi Saghinadze (Tbilisi SU) 11 Oct 2008 18:51
rofl no comments :D
Re: why WA10?
Posted by Anton 18 Oct 2008 15:58
Don't you think, that 10^24 doesn't fit into double? =/ with your formula, you should use BigDecimal...

Edited by author 18.10.2008 15:59
Re: why WA10?
Posted by ErOPb|4[USU] 18 Oct 2008 19:06
long long type give me WA10! When I replaced the long long to long double I get AC
Re: why WA10?
Posted by svr 18 Oct 2008 23:33
You are right!
It's importent not magnitude 10^24 but
condition number of the problem and number of right
digits in result:7+9=16<18