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 1720. Summit Online Judge

Please,give me some hints or advices to solve this problem
Posted by ahmedov(NUUz_2) 13 Oct 2009 19:21
Please,give me some hints or advices to solve this problem
Re: Please,give me some hints or advices to solve this problem
Posted by svr 13 Oct 2009 20:59
help fr5om mathemation.
For me was interesting mathematical nature of the problem.
I got Ac under next understanding.
We must find volume of intersection [l.r]
with dison union of [kx,ky] and [k0*x,infinity]
Re: Please,give me some hints or advices to solve this problem
Posted by ahmedov(NUUz_2) 14 Oct 2009 17:19
Thank you for your answer. I'm sorry, but i did not understand your method. Can you describe your method more widely.
Re: Please,give me some hints or advices to solve this problem
Posted by svr 14 Oct 2009 17:26
Form disjoint segments:[kx,ky],k=1,2,3..
When [kx,ky] will intersect with [(k+1)x-1,(k+1)y]
at k=k0:stop. From this moment we have [k0*x,infinity[
After standard programming task: find intersection
of given segment[l,r] and disjoint system of closed segments.

Edited by author 14.10.2009 17:30
Thank you very much.Now AC
Posted by ahmedov(NUUz_2) 15 Oct 2009 19:07


Edited by author 15.10.2009 19:22
Re: Thank you very much.Now AC
Posted by svr 15 Oct 2009 20:30
Congratulage!
To implment that isue to be great!
Re: Thank you very much.Now AC
Posted by Bogatyr 5 Oct 2012 21:20
Very interesting problem, took me 2 days :).   I started out wrong, but then saw the progression of [kx,ky] and the gaps between them.   My solution subtracts the gaps from [l,r].   I had an initial misconception of the progression of the gaps, but corrected it and got AC.  It's interesting that if y > x then the gaps will always shrink to size zero, eventually.