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 1990. Podracing

WA23
Posted by andreyDagger`~ 3 Jan 2024 20:12
It's very strange but it seems that even long double precision doesn't enough for this problem. I had function get_x(polyline, y), that calculates x coordinate of polyline on coordinate y. I implemented it through binary searching and then calculating by formula, but that resulted in WA23. Then I made an optimisation: if polyline has integer point with coordinate y: (x, y), I instantly return x.

Edited by author 03.01.2024 20:12