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 1927. Herbs and Magic

Hint for checking if two segments are parallel
Posted by PrankMaN 24 May 2020 04:14
Since input numbers are integers, pseudovector product absolute value will be at least 1 if they aren't parallel, so you can compare it to 0.5 to have bigger margin for double precision error.
Re: Hint for checking if two segments are parallel
Posted by Harkonnen 17 Aug 2022 05:31
Just get cross-product (dx1*dy2-dx2*dy1). If it's zero - they are parallel.