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

Обсуждение задачи 1541. Погоня

is there a solution?
Послано RAVEman 8 мар 2007 04:42
is there any solution for this problem that is not based on the exhaustive search?
Re: is there a solution?
Послано MikleB 14 мар 2007 01:35
Google aliquot fractions
Re: is there a solution?
Послано Denis Koshman 15 июл 2008 02:21
Yes, there is. I recursively try all denominators <= 100000 walking on primes - this way I automatically get all of its divisors at no cost and then DP in order to sum up to nominator using <20 of denoninator's divisors. Interestingly, the bigger the limit, the faster it performs.
Re: is there a solution?
Послано svr 6 янв 2011 08:49
Next reasoning should work:

if (1/(n+1)<A<1/n => A=1/(n+1)+B,
where B<1/(n*(n+1)) and
cannot contain 1/(n+1) again
Thus 1/v1,1/v2,... is basis
that converges to A very quickly
A is rational then
sequence must be finite
Re: is there a solution?
Послано bsu.mmf.team 24 авг 2011 02:48
It's true, but there exists the limit for a denominator of fractions in this problem. I tried this algo in my first solution, and got WA#3.

Edited by author 01.12.2015 19:01