Back to task

279 symbols perl
Mon Sep 29 20:04:30 2014 vakorol
#!/usr/bin/perl -p
%h=qw|/ -1 \ 1|;$s=$i if/\@/;$a[$i++]=$_;sub u{my$u;$u+=$_ for@_;$u}sub c{my($j,$p,$v,$k,$q)=@_;my$l=substr$a[$j],$p,$v;my$r=$l=~m#^ *(\S) #?c($j+$h{$1},$p,$v):u(@d=$l=~/\d+/g);$k=$p+$-[0],$q=length$&,$r+=1/(1/c($j-1,$k,$q)+1/c($j+1,$k,$q))while$l=~/(< +>)/g;$r}}{$_=c($s,0,99)


Leave a comment

Parsed as Markdown

Login to leave a comment