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

Обсуждение задачи 1987. Вложенные отрезки

i'm sad
Послано Two-Eight-Nine [[ §289]] 2 янв 2014 15:27
Algo O(nm) works for 1.046 sec,
but O(2n) uses more than 65536kb.


Edited by author 02.01.2014 15:28
Re: i'm sad
Послано Evgeniy_Chernobrovkin(MUCTR-2013) 21 янв 2014 06:15
1.031 for O(NxM) with pre-exit after left coordinate of segment > coordinate of point.
Any idea for modifications?
Re: i'm sad
Послано adamant 22 янв 2014 16:37
0.625 for O(mlogn) solution using C++ STL set... I think the problem is harder, than its difficulty score if there is no easier solution.
Re: i'm sad
Послано adamant 24 янв 2014 14:18
Well, okay, there is a O(mlogn) solution with sorting only and 0.125s execution time.
Re: any detailed algorithm?
Послано Nodir NAZAROV Komiljonovich 10 фев 2014 21:47
Can you please write some more details for sorting based algorithm?
Re: any detailed algorithm?
Послано Evgeniy_Chernobrovkin(MUCTR-2013) 21 фев 2014 19:43
I think you can search for red-black trees algo, it has O(nlogm) but its realy hard as for me.
Small(?) hint
Послано Leonid 14 мар 2014 11:03
This problem can be solved fast, if you'll try not to consider common solution, but only this ( there is some useful limits in statement, also order is very convenient  ) case.
Small hint, that I promised: Imagine a big-length wall, like in old platformers, where segments are vertical levels and segment's coords are horizontal coords.
Example:
4
2 10
2 3
5 7
6 7

00000011000
00110111000
00111111111
1 are bricks in our wall.

Edited by author 14.03.2014 11:03
Re: Small(?) hint
Послано a6 14 мар 2014 13:38
FUCKING PIGS SUCK A DICK
Re: i'm sad
Послано Dmytro Dziuma (DixonD) [Lviv NU] 24 апр 2014 04:06
Since the input is sorted already, there is a O(n+m) solution