fork download
  1. print $^V;
  2. while(<>){
  3. ($n, $m) = split;
  4. # $n == 1 and do {print 1; next};
  5. # $m = sprintf "%b", $m - 1;
  6. # $m =~ s/^/0/ while $n - 1 > length $m;
  7. # $m =~ s/./ push @{$&}, ++ $i /eg;
  8. # $, = $";
  9. # print @{0},"$n", sort {$b <=> $a} @{1}
  10. }
Success #stdin #stdout 0s 6000KB
stdin
49 120715613380345
stdout
v5.20.1