######################### 1831 ##############################
use 5.010;</p><p>chomp(my $ord = <STDIN>);</p><p>chomp(my $change = <STDIN>);</p><p>say $change;</p><p>say $ord;</p><p>while(<>){</p><p> eval "tr/$ord/$change/ ";</p><p> print;</p><p>}
######################### 1854 ##############################
my %hash;</p><p>while(chomp(my $party = <STDIN>)){</p><p> for(1..$party){</p><p> chomp(my $name = <STDIN>);</p><p> chomp(my $cand = <STDIN>);</p><p> $hash{$name} = $cand;</p><p> }</p><p> chomp(my $n = <STDIN>);</p><p> my %hash_vote;</p><p> for(1..$n){</p><p> chomp(my $vote = <STDIN>);</p><p> $hash_vote{$vote} ++;</p><p> }</p><p> my @arr = sort {$b <=> $a} values %hash_vote ; # desc sort</p><p> if( $arr[0] == $arr[1]){</p><p> print "tie/n" ;</p><p> }else{</p><p> for (keys %hash_vote){</p><p> print $hash{$_} , "/n" if $hash_vote{$_} == $arr[0] ;</p><p> }</p><p> }</p><p> undef %hash; # empty the Hashtalbe</p><p> undef %hash_vote; # empty too</p><p>}
######################### 1858 ##############################
use 5.010;</p><p>while(<>){</p><p> tr/BFPVCGJKQSXZDTLMNR/111122222222334556/;</p><p> s/(.)/1*/$1/g;</p><p> s//D//g;</p><p> say ;</p><p>}
######################### 2176 ##############################
use 5.010;</p><p>while(chomp(my $case = <STDIN>)){</p><p> last if $case eq '-1' ;</p><p> my $time = 0;</p><p> my $sum = 0;</p><p> while($case--){</p><p> chomp(my $line = <STDIN>);</p><p> my @arr = split ' ',$line;</p><p> $sum += $arr[0] * ($arr[1] - $time);</p><p> $time = $arr[1];</p><p> }</p><p> say "$sum miles";</p><p>}
######################### 2201 ##############################
use 5.010;</p><p>chomp(my $n = <STDIN>);</p><p>for(1..$n){</p><p> my @arr = split ' ',<STDIN>;</p><p> $arr[0] < $arr[1] ? say "NO BRAINS" : say "MMM BRAINS";</p><p>}
######################### 2417 ##############################
while(<STDIN>) {</p><p> chomp;</p><p> last if !$_;</p><p> my $n = 0;</p><p> until( ($_%2) ){</p><p> $n ++;</p><p> $_ /= 2;</p><p> }</p><p> print 1<<$n ,"/n";</p><p>}
######################### 3333 ##############################
use 5.010;</p><p>chomp(my $case = <STDIN>);</p><p>for(1..$case){</p><p> my($p, $p1, $p2) = split ' ', <STDIN>;</p><p> abs $p-$p1 > abs $p-$p2 ? say 'B' : say 'A';</p><p>}
ZOJ( 1001 | 1048 | 1109 | 1151 | 1240 | 1241 | 1608 | 1808 ) Perl版本