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

How I have beaten Runtime Error on python and got AC
Posted by Maxim Rodionov 20 Apr 2023 21:49
You have to make one more "if"
######################################################################################
d = math.sin(p1) * math.sin(p2) + math.cos(p1) * math.cos(p2) * math.cos(abs(l1 - l2))
if str(d) == '-1.0000000000000002':
    d = int(d)
d = math.acos(d) * 3437.5
######################################################################################
there is a test where '-1.0000000000000002' in d so thats why acos gives error, you have to change '-1.0000000000000002' to -1

Edited by author 20.04.2023 21:49

Edited by author 20.04.2023 21:49