Editorial for ICPC NWERC 2014 F - Finding Lines


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Given n points in R2, is there a straight line passing through at least a p fraction of them?

  • If line exists it is uniquely determined by any two of its points.
  • Probability that a random point lies on the line is p.
  • Repeat 250 times:
    1. Pick two distinct points uniformly at random
    2. Check if line defined by the points has enough points.
  • Pr[false negative](1p2)250(1125)250<4×105 (cheated slightly – it's a bit worse)

Many other ways e.g. divide and conquer


Comments

There are no comments at the moment.