ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1326. Bottle Taps

AC......but too slow!
Posted by Yu YuanMing 11 Oct 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!
Posted by Denis Koshman 3 Aug 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!
Posted by hoan 7 Dec 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!
Posted by IgorKoval(from Pskov) 17 May 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!
Posted by ძამაანთ [Tbilisi SU] 8 Oct 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 :|