in reply to Google Code Jam 2019 Round 1A Problem 1: Pylons

I don't think you need rand, when dealing with bigger grids.

Hint: do you know how the knight moves in chess? ;-)

Smaller grids can be brute forced.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

  • Comment on Re: Google Code Jam 2019 Round 1A Problem 1: Pylons

Replies are listed 'Best First'.
Re^2: Google Code Jam 2019 Round 1A Problem 1: Pylons
by choroba (Cardinal) on Apr 14, 2019 at 22:07 UTC
    Feel free to solve the problem. Knight's moves aren't enough for some grid sizes.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      > Knight's moves aren't enough for some grid sizes.

      which sizes bigger 4x4?

      It's a bit more complicated, but since it's an open competition I don't wanna reveal too much.

      > Feel free to solve the problem.

      no time to code this at the moment.

      (you know mathematicians are like eunuchs ... ;)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      update

      see here