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

Обсуждение задачи 1588. Ямайка

asdsdf What is the best algorithm? [6] // Задача 1588. Ямайка 1 ноя 2007 12:42
I use O(n^3), but i meet time  problem. Can you help me?
LittlePig Re: What is the best algorithm? [5] // Задача 1588. Ямайка 1 ноя 2007 14:32
Of course, the best complexity is O(N^2 log N), but O(N^3) can get AC.
EugeneE Re: What is the best algorithm? [4] // Задача 1588. Ямайка 17 дек 2008 21:17
Can anybody in short explain how to create O(N^2 logN) algorithm, please?

I've already accepted O(n^3) solution and there's no promlem with it(definitely not the best implementation of this algorithm got ac in 0.2 sec), but how to create O(N*NlogN) algo?
Abzal Re: What is the best algorithm? [1] // Задача 1588. Ямайка 22 авг 2011 05:53
Use angle sort, after use binary search.
Enigma [UB of TUIT] Re: What is the best algorithm? // Задача 1588. Ямайка 28 сен 2011 13:07
I've Accepted O(N*NlogN) :)
[MAI] iLoveDiscreteAnalysis Re: What is the best algorithm? [1] // Задача 1588. Ямайка 10 фев 2012 18:12
N^2 * log(N^2) algo:

1) Sort n^2 lines by distance.
2) Iterate from largest to smallest.
3) We have to add line to the answer, if we not have bigger line in set, covering this. We can easily check it with set.
Andrew Sboev [USU] Re: What is the best algorithm? // Задача 1588. Ямайка 26 мар 2013 21:13
O(N^3) easily gets AC in 0.078s.