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

Обсуждение задачи 1326. Крышки

AC......but too slow!
Послано Yu YuanMing 11 окт 2004 22:57
  I regard it as a graph theory problem,and solve it in O(M*2^N).
  But it is very slow,so I would like to hear some others' algorithm.Maybe we can make progress together.
  Contact me: yym2008@hotmail.com
Re: AC......but too slow!
Послано Denis Koshman 3 авг 2008 16:12
Just get only bottles he wants (ignore others). Perform mix-up by bit-wise OR (I think you did it). And use heap for Dijkstra - it works very well because |E| < |V|
Re: AC......but too slow!
Послано hoan 7 дек 2010 20:03
thanks Denis Koshman, first i Time limit exceeded in test 11, when i use your hint i AC in 0.453 s, i dont forgot your hint in all my life :D.

GOOD LUCK!!!
Re: AC......but too slow!
Послано IgorKoval(from Pskov) 17 май 2012 18:26
How can I regard it as a graph theory problem??? What do edges mean and what do vertex mean?

Edited by author 17.05.2012 18:31
Re: AC......but too slow!
Послано ძამაანთ [Tbilisi SU] 8 окт 2013 23:08
ive got the same problem my solutions (both using function w/ memoization and precomputing all the possible bitmasks before answering) pass the time limits but are 6-7 times slower :|