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

Обсуждение задачи 1126. Магнитные бури

Please, help me to solve this problem!
Послано Bedny Yuri (bedny@rain.ifmo.ru) 16 фев 2002 22:30
First of all, I sorry for my bad English.
Please help me to solve this problem. I wrote solution, but my
program works very slow(>0.5). I think that idea of my solution is
bad. Please help me!
You may use(+)
Послано Miguel Angel 17 фев 2002 02:49
Well my solution isn't the fastest but is quick. Maybe is something
complicated, but as you may see the data are ordered like a queue and
you want to determine of all the data in the queue which one is the
greatest, print it, and then throw the first, add the later and do
the operation again. Hint: There's a Data Structure which does
exactly this :).
Doubts?: miguelangelhdz@hotmail.com
Re: You may use(+)
Послано Junjie Liang 21 мар 2002 16:52
Are you referring to a heap? Because that's was the first things that
came to my mind (and nothing else so far)...

If you are referring to a heap, could you explain how you decide
which one to "throw away"? I can't seem to fit the idea of a queue
and heap together...