fork(1) download
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. my @stack = split //, '9332682811';
  6.  
  7. while () {
  8. @stack[-1, -2] = @stack[-2, -1];
  9. push @stack, $stack[-1];
  10. $stack[-1] -= 9;
  11. last unless pop @stack;
  12. @stack[-1, -2] = @stack[-2, -1];
  13. $stack[-1] *= 9;
  14. {
  15. my $x = pop @stack;
  16. $stack[-1] += $x;
  17. }
  18. }
  19. pop @stack;
  20. print $stack[-1], "\n";
Success #stdin #stdout 0s 17760KB
stdin
Standard input is empty
stdout
52256370