|
|
back to boardAC......but too slow! 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! 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! 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! 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 :| |
|
|