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 1294. Mars Satellites

Do I miss some conditon, or maybe I have some extra's
Posted by Marko Bogdanovic 11 May 2005 04:05
My formula is probably ok., I think I get WA because of special conditions so here is what I check:

1. ad*ac-bd*bc == 0 => impossible, because we can't divide with zero.
2. ad*bc+ab*cd != ac*bd => impossible, because than orbit is not circle, according to Phtolomei's theorem
3. final score is cd=sqrt(formula), where "formula" is my math solution without root, so I check if formula<0, because there is no root of negative value.

Do I miss some conditon here (for some input value of ad, ac, bc, bd maybe?), or maybe I have some conditon that I don't need??
Please help me here!

Edited by author 11.05.2005 04:07
Re: Do I miss some conditon, or maybe I have some extra's
Posted by Burunduk1 11 May 2005 09:51
In my AC solution I didn't use the second condition.
In what type you store data? int, int64, double?
Re: Do I miss some conditon, or maybe I have some extra's
Posted by Marko Bogdanovic 12 May 2005 03:22
I store data in double and int, I have  few conversion double->int and oposite. Do I need __int64 or long double?
Re: Do I miss some conditon, or maybe I have some extra's
Posted by Burunduk1 12 May 2005 04:13
In my AC program I used only double.
Try to change all int to double.
Re: Do I miss some conditon, or maybe I have some extra's
Posted by Marko Bogdanovic 13 May 2005 00:33
Perhaps my formula is wrong, here it is :
(I used characteristics of inscribed ugle and cosin theorem)
cd = (ad*ad + ac*ac - (ad*ac*bd / bc) - (ad*ac*bc / bd)) /
      ( 1 - (ad*ac / (bd*bc)));
cd = sqrt(cd);
Maybe this exspression where I divide (1 - (ad*ac / (bd*bc)) is not good for some input data because I forbid divide with zero?

Edited by author 13.05.2005 00:36

Edited by author 13.05.2005 04:45
this problem cos_a can be > 1
Posted by Виктор Крупко 13 May 2005 01:50
1. ad*ac-bd*bc == 0 => impossible, because we can't divide with zero.
2. ad*bc+ab*cd != ac*bd => impossible, because than orbit is not circle, according to Phtolomei's theorem
3. final score is cd=sqrt(formula), where "formula" is my math solution without root, so I check if formula<0, because there is no root of negative value.

1 yes
2 no
3 Through system of the equations express cos_a, and then find the side.
No subject
Posted by Fly [Yaroslavl_SU] 11 Oct 2005 13:12
Why if ad*ac-bd*bc==0 it's impossible? In some place it is really impossible, but not for test:
1 2 2 1
I can select any length from interval (1,3) and it should be right answer!
It's not impossible, but in this case it *is* impossible to determine DC unambiguously, so the anwer is "Impossible." (-)
Posted by Michael Rybak (accepted@ukr.net) 10 Feb 2006 16:48
-