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

Marko Bogdanovic Do I miss some conditon, or maybe I have some extra's [7] // Problem 1294. Mars Satellites 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
In my AC solution I didn't use the second condition.
In what type you store data? int, int64, double?
I store data in double and int, I have  few conversion double->int and oposite. Do I need __int64 or long double?
In my AC program I used only double.
Try to change all int to double.
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 // Problem 1294. Mars Satellites 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.
Fly [Yaroslavl_SU] No subject [1] // Problem 1294. Mars Satellites 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!