polosatic's blog

By polosatic, history, 4 weeks ago, In English

Recently I was upsolving this problem. My subtask was as follows: given three points: A, B, C, and I need to find the intersection point of 2 lines: AB and OC, where O has (0;0) coordinates.

Code, 90/92 tests passed

At first I wrote this using a formula (find() function) and got WA on 2 tests. Then I wrote it using binary search (findgood() function) and got AC. Then I submitted the solution above with find() and #define ld __float128, and it passed.

Can anybody explain what actually happened? How can formula be less precise than binary search?

  • Vote: I like it
  • +16
  • Vote: I do not like it