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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Given points in , is there a straight line passing through at least a 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 .
- Repeat times:
- Pick two distinct points uniformly at random
- Check if line defined by the points has enough points.
- (cheated slightly – it's a bit worse)
Many other ways e.g. divide and conquer
Comments