Page 7 of 7

Re: 143 - Orchard Trees

Posted: Thu Jul 20, 2017 11:44 pm
by rafastv
Hi, there, some tips for you if you suffered with this problem.

1) You must consider lines and points too besides triangles.

2) Pay attention to PRECISION of your floating-point variables, 1e-9 is enough.

3) Try at first solving the problem through brute force and when you are able, only then, solve it through a more refined method.

4) Many of the samples here are not valid input, remember the description of the problem there is no input like 0.999999999999 or something like that, but you must be able to handle such a number if it appears in your computations. The worst number I've found for point inside triangle test was something like U -0.00000000000000013366500403377148334747596430321874 and V 0.944444444444445.

Good luck!