|
|
вернуться в форумHave you any tricks how to solve? Subj Re: Have you any tricks how to solve? No, just bruteforce... Re: Have you any tricks how to solve? >No, just bruteforce... A little optimized bruteforce gave me TLE in 'n' < ~20 There is a simple pattern in frogs moving. Paper simulation is so bored pastime - I had found out the pattern when wrote simple bruteforce for small 'n' cases. GL :) Re: Have you any tricks how to solve? Послано MarX 27 июл 2015 10:45 I found a pattern on the movemente... move first black frog Then: move first & second white frog then: move first & second & third black frog keep doing this until the end while doing that: always start for the first frog that hasn't arrive to their final position always end if you don't have anymore frogs to move example with 2 and 3 8 1 3 4 2 0 1 3 2 15 2 4 5 3 1 0 2 4 6 5 3 1 2 4 3 Good luck |
|
|