ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1191. Держи вора!

Hints (+) {just use 3 shortint}
Послано Locomotive 17 фев 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}
Послано Nickolas Kakà 5 июл 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}
Послано xEugene 2 фев 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}
Послано adamant 25 янв 2014 13:18
But minimum amount if trams is [L/k[i]], not L%k[i] Oo