Page 1 of 1

Flash Flood Warmup

Posted: Tue Oct 11, 2011 7:58 pm
by Rat62
'Flash Flood Warmup' is rated '10' while 'Deluge' is 55. By intention?

My first tries were at about 27000 cycles (simple recursive approach). Then I noticed that it is always the same image, filled those 3 islands with 2's (enumerating 30 cells) and then marked all cells 0 if they are 2 or 1 otherwise. Took less than 10000 cycles. I'd call that cheating and probably not the way it was intended.

Posted: Fri Apr 04, 2014 3:53 pm
by Hippo
I have tried to change the algorithm from trivial DFS/BFS ... I have used variant of union find on 0 regions ... and if I remember well I did the warmup with it. But for the next level I was not able to lower the cycle count enough and I have returned to the almost trivial DFS with several enhancements ... let us see what will work second next level.

Posted: Tue Sep 15, 2015 4:23 pm
by stubbscroll
I managed to solve this in 23054 cycles with a recursive flood-fill algorithm. I used one optimization: Split the recursive routine into 4, each of the 4 routines doesn't re-check the direction where we came from.

Posted: Sat Aug 20, 2022 2:42 am
by Simonselles
Fun fact: we don't need to print all the values after flooding. :facepalm:
After a long struggle, I went down to 20241 with printing.