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 1191. Catch the thief!

Hints (+) {just use 3 shortint}
Posted by Locomotive 17 Feb 2003 09:57
Hi
I had solved this problem with just 3 shortint...
It so easy look other messages in this problem to understand what is
happening!
All you need is:

    dec(n,n mod y);

where y is that K[i]`s which described in problem.
nothing is special for this problem...
With best Wishes
Aidin_n7@hotmail.com
Re: Hints (+) {just use 3 shortint}
Posted by Nickolas Kakà 5 Jul 2008 20:54
This way is so incredible!
Could you explain why it's correct and what does this problem mean?
Thanks.
Re: Hints (+) {just use 3 shortint}
Posted by xEugene 2 Feb 2009 23:14
Obviously, distance between cop and robber can only decrease.
If cop cannot overtake robber at current stage(if L >= k[i]), so new min distance in the best case for policeman will be equal to (minimum amount of trams)*k[i].
And minimum amount of trams is L mod k.
For instance, L=7, K=3, so policeman will miss at least 2 trams: robber will reach tram stop, wait at most 3 mins and go away. Policeman will miss next tram, and he should wait another 2 mins before next tram will come. So, new L = 2*K = 6.
Re: Hints (+) {just use 3 shortint}
Posted by adamant 25 Jan 2014 13:18
But minimum amount if trams is [L/k[i]], not L%k[i] Oo