Crummy problem :( ----- (because random)
This is a permutation problem with a weak ordering requirement.
"shuffle" the grid indexes, about half the time always taking the first non-conflict from the array of empty indexes gives a valid order, if not, reshuffle till it works.
I am seeing on average slightly less than one reshuffle per grid solution over all the grids.
Processes all 361 grids in under 2 seconds total typically.
( slight cheat: All IMPOSSIBLEs are hard coded (HINT: there are very few) :)
It's not in final submit form because I wanted to test all grid sizes.
In reply to Re: Google Code Jam 2019 Round 1A Problem 1: Pylons
by tybalt89
in thread Google Code Jam 2019 Round 1A Problem 1: Pylons
by choroba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |