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 1388. Photo

solution:
Posted by Shen Yang 5 Nov 2017 12:37
suppose the slope of line on the x>0 is k ,and slope of (0,0) to n
points is k1,k2,...kn then intersection point of x1==1/(k1-k),x2=1/(k2-k)...xn=1/(kn-k)
then we choose (x4-x1)/(x2-x1)==(x4'-x1')/(x2'-x1') and (x3-x2)/(x3-x4)==(x3'-x2')/(x3'-x4')
we multiply these two equations guess what happens, yes: k is offset
then we can get (k4-k1)*(k3-k2)/((k2-k1)*(k3-k4))==(k4'-k1')*(k3'-k2')/((k2'-k1')*(k3'-k4'))
en.. this convert to string matching prolems,so suffix array can solve it
Re: solution:
Posted by devil 24 Oct 2018 07:52


Edited by author 26.10.2018 10:33