Last active
December 7, 2016 22:19
-
-
Save dogbert17/41042137f44394a0094c1cc1c05055bb to your computer and use it in GitHub Desktop.
SEGV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
my $size = 3001; | |
my int @mat[$size; $size]; | |
init-array(0, $size - 1, $size * $size); | |
say 'done'; | |
sub init-array($r, $c, $val) { | |
@mat[$r; $c] = $val; | |
if $c - 1 >= 0 | |
{ # left | |
init-array($r, $c - 1, $val - 1); | |
} | |
elsif $r + 1 < $size | |
{ # down | |
init-array($r + 1, $c, $val - 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment