|
|
вернуться в форумHelp me! Послано AXIS 5 фев 2007 23:44 I always got Stack Overflow on test 6, help! [code deleted] Edited by moderator 13.02.2007 20:52 Re: Help me! I don't remeber... Add this text in your program, before {APPTYPE CONSOLE} {$MAXSTACKSIZE $10000000} This number it is your stack size. Re: Help me! Don't use DFS :-) Re: Help me! Послано AXIS 6 фев 2007 23:12 Thanks) Stack size don't work, i tried. P.S. How to BFS?) Re: Help me! Thanks) Stack size don't work, i tried. ) Whats the problem?? {$M 16000000} //From FAQ Re: Help me! Послано AXIS 6 фев 2007 23:47 It's a kind of magic) i've forgotten Pascal completely... MaxStackSize - this is Delphi code... Now, it's WA6=) Re: Help me! Послано AXIS 7 фев 2007 00:08 This problem gonna take my brain... Why WA??? Re: Help me! It's a kind of magic) i've forgotten Pascal completely... MaxStackSize - this is Delphi code... Now, it's WA6=) The $MINSTACKSIZE and $MAXSTACKSIZE directives are used in Windows programming only. As I know 2 DFS is needed for this problem Re: Help me! Послано AXIS 7 фев 2007 00:35 I've written two BFS - WA6. My idea in this code - finding in the vertex V the furthest vertexes, that they are in different subtrees in tree with root V. Something like that, hard to explain) Re: Help me! First BFS - finding the free cell A that is the furthest from some free cell. Second BFS - finding the free cell B that is the furthest from cell A. Re: Help me! Послано AXIS 7 фев 2007 20:10 AC finally.. But i don't understand, why dfs solve doesn't work Re: Help me! AC finally.. But i don't understand, why dfs solve doesn't work I've solved it with dfs It's very simple and fast If you want I can send my solution to you Re: Help me! Just 2 waves. I had WA#6, when I used short int instead of int for my lenght variable. Re: Help me! Thanks {$M 16000000} helped me. finaly AC with 0.046s, but 10Mb memory. I used simple recursion. |
|
|