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

Общий форум

Can someone give me an idea to solve 1119???
Послано michel mizrahi 28 июн 2005 06:36
First of all sorry for my bad english.
I only think in solve this problem by sorting the points in a way I can check from the most east-south point to the most north-west point, but for every point I must check all posibilities, I mean, for every point I choose to cross the diagonal I have to check all the posibilities of doing with the other points because the fact that the point is on the most east or most south position isn't enough reason to use it, so it will give me a really slow algorithm.. I am really stuck with this problem, if someone can help me I would appreciate a lot...
I also note that there are some other problems that you can solve in the same way of solve this
thanks a lot!
Re: Can someone give me an idea to solve 1119???
Послано ICh(USU) 28 июн 2005 14:27
Dynamic programming
Re: Can someone give me an idea to solve 1119???
Послано michel mizrahi 4 июл 2005 06:25
and some other clue to know how to use dynamic programming in this problem??
Re: Can someone give me an idea to solve 1119???
Послано ICh(USU) 4 июл 2005 14:44
Assume Row[0..1,0..max]of real is best answer for previous
row (Row[0]) and for current row (Row[1]). Init:Row[0,i]=i.
Then in each iteration of cycle you find shortest path:
try to move left(or right),then up and, if it exist, to diagonal. After all you must mark current row as previous.