Topological Sort

Score: 114.53 (pass)

mmm.. bacon..

#!perl -lp0
@e{@a=split}=1;$o=join$\,keys%e;1/!eval'grep/ /&$o=~s#^(\Q$\'\E)$((.|
)*
)(\Q$`\E)$#$4$2$1#m,/.*/g;'x@a;$_=$o

Score: 122.58 (pass)

passes on 1.8 for me, anyway. Of course, this does not assure that the solution is valid :)

#!perl -lp0
@e{/\S+/g}=1;$o=join"
",keys%e;1/!eval'grep/(\S+) (\S+)/&$o=~s/^(\Q$2\E)$((.|
)*)^(\Q$1\E)$/$4$2$1/m,/.*/g;'x99;$_=$o

Score: 123.53 (pass)

Although a baconiser does sound like a good idea.

#!perl -lp0
@e{@a=split}=1;$o=join$\,keys%e;1/!eval'grep/(\S+) (\S+)/&$o=~s/^(\Q$2\E)$((.|
)*)^(\Q$1\E)$/$4$2$1/m,/.*/g;'x@a;$_=$o

Score: 123.57 (pass)

hurrah! I join the ranks of those whose score is less than twice Ton's!

#!perl -lp0
@e{/\S+/g}=1;$o=join"
",keys%e;$_=eval'grep/(\S+) (\S+)/&$o=~s/^(\Q$2\E)$((.|
)*)^(\Q$1\E)$/$4$2$1/m,/.*/g;'x99?die:$o

Score: 124.57 (pass)

curse you referees, and your insane love of non-hard-coded limits! p.s. I am not convinced that 'baconise' is a word.

#!perl -lp0
@e{/\S+/g}=1;$o=join$\,@l=keys%e;1/!eval'grep/(\S+) (\S+)/&$o=~s/^(\Q$2\E)$((.|
)*)^(\Q$1\E)$/$4$2$1/m,/.*/g;'x@l;$_=$o

Score: 136.48 (pass)

I have another solution in the pipeline, but those damn metacharacters are a right royal pain!!

#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=@a[$j,$i]if/^\Q$a[$j] $a[$i]
/m}}'x@a;$s?die:print for@a

Score: 137.48 (fail)

ref: my 140 passed 1.5 on my machine, and so does this. If this fails, can you let me know where?

#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=@a[$j,$i]if/^\Q$a[$j] $a[$i]\E$/m}}'x9;$s?die:print for@a

Score: 138.48 (pass)

sorry 'bout that.

#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=@a[$j,$i]if/^\Q$a[$j] $a[$i]\E$/m}}'x@a;$s?die:print for@a

Score: 140.48 (fail)

I don't remember changing anything, but this is two shorter

#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){map{$s=@a[$i,$j]=@a[$j,$i]if"@a[$j,$i]"eq$_}/.*/g}}'x9;$s?die:print for@a

Score: 140.53 (fail)

86! Does not compute! Bzzzt! Does not compute!

#!perl -p0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=($1,$2)if/^($a[$j]) ($a[$i])$/m}};'x9;$s&¨$"="
";$_="@a
"

Score: 142.48 (fail)

hopefully this will get me out of the sand trap.

#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=@a[$j,$i]if grep"@a[$j,$i]"eq$_,/.*/g}};'x9;$s?die:print for@a