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

Общий форум

About 1028 Stars.
Послано Smasher_nine 25 окт 2000 04:39
Any ideas about really simple and efficient algorithm that
does the job in the time bounds.I tried keeping sorted
array or binary tree but they get TLE.When I test it at
home i never get TLE with random tests.They obviously try
tests like all the points with increasing or decresing x.I
can only think of balanced trees and I don't like B
trees.Also I have several other optimizations and I think
my code should get 5 secs at most even with samples like
all the stars with increasing x.My other idea was assembler
but did anyone try asm, does it work?
I kept the array sorted and that solved the problem in 2.2 sec. try using C++ instead of pascal (-)
Послано Ilya Semenov (NSU) 25 окт 2000 23:52
Re: About 1028 Stars.
Послано Petko Minkov 26 окт 2000 02:31
> Any ideas about really simple and efficient algorithm
that
> does the job in the time bounds.I tried keeping sorted
> array or binary tree but they get TLE.When I test it at
> home i never get TLE with random tests.They obviously try
> tests like all the points with increasing or decresing
x.I
> can only think of balanced trees and I don't like B
> trees.Also I have several other optimizations and I think
> my code should get 5 secs at most even with samples like
> all the stars with increasing x.My other idea was
assembler
> but did anyone try asm, does it work?

 Straightforward N^2 worked in 2.5 secs.