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 1030. Titanic

Olzhas2dy Some info about this problem [10] // Problem 1030. Titanic 30 Mar 2007 05:23
Hello, everyone.
Just wanted to summarize some info about this problem.
Ok, my code got AC with following things in it:
1. My pi was 3.1415926535897932384626433 (perhaps it is enough)
2. I used this formula from wikipedia
deltaArc=acos(sin(phiA)*sin(phiB)+cos(phiA)*cos(phiB)*cos(deltaL));
distance = deltaArc*3437.5;
(see the first formula from wikipedia http://en.wikipedia.org/wiki/Great-circle_distance)
3. I used the following condition:
if(100.00-distance>0.005) printf("DANGER!\n");
Hope it will help somebody.
Javran Re: Some info about this problem // Problem 1030. Titanic 14 Oct 2007 16:35
thanks a lot ...your formula is really useful.^_^
Lomir Re: Some info about this problem // Problem 1030. Titanic 11 Nov 2007 02:13
Used everynth what is written here. However still WA8.
Any new ideas?...
Sihang Re: Some info about this problem [3] // Problem 1030. Titanic 26 Jan 2009 16:34
kiitos
Imran Yusubov Re: Some info about this problem // Problem 1030. Titanic 13 Aug 2009 17:01
Thanks in advance!!
Imran Yusubov Re: Some info about this problem // Problem 1030. Titanic 13 Aug 2009 17:01
Thanks in advance!!
Imran Yusubov Re: Some info about this problem // Problem 1030. Titanic 13 Aug 2009 17:01
Thanks in advance!!
Xan Tei Jun Re: Some info about this problem // Problem 1030. Titanic 26 Oct 2009 13:03
Thanx for your hint
Bumstern Re: Some info about this problem [2] // Problem 1030. Titanic 23 Sep 2018 13:18
Do u know that pi can be calculated by this formula: atan(1) * 4?
Solver Re: Some info about this problem [1] // Problem 1030. Titanic 14 Jul 2026 07:12
acos(-1)
Solver Re: Some info about this problem // Problem 1030. Titanic 14 Jul 2026 07:37
Also if you use acos on dot-product to get distance over sphere, beware that acos(-1.000000001) or acos(+1.000000001) will give NaN, so clamp argument to [-1, +1] range explicitly.