Topological Sort
Score: 83.37 (pass)
Finally, a breakthrough -- though I fear I'm still stuck in a local minimum
#!perl -ln0
s/^(.+) \1$/$1/gm;print(($s)=grep$s!~/ \Q$_
/,split)/s/^\Q$s\E\s//gmwhile$s=$_
|
Score: 91.48 (pass)
Saved a space by changing $s to $"
#!perl -ln0
s/^(.+) \1$/$1/gm;s/^\Q$"\E\s//gm,print$"while$"=$_,($")=grep$"!~/ \Q$_
/,split;S/!/./
|
Score: 92.37 (pass)
It's now possible to change the for(;;) to a while modifier. Doesn't save any strokes, but lowers the tiebreaker.
#!perl -ln0
s/^(.+) \1$/$1/gm;s/^\Q$s\E\s//gm,print$s while$s=$_,($s)=grep$s!~/ \Q$_
/,split;S/!/./
|
Score: 92.38 (pass)
Moved print to save a stroke, then added gratuitous obfuscation
#!perl -ln0
for(s;^(.+) \1$;$1;gm;$s=$_,($s)=grep$s!~/ \Q$_
/,split;print$s){s}^\Q$s\E\s}}gm}S/!/./
|
Score: 93.46 (pass)
#!perl -ln0
for(s/^(.+) \1$/$1/gm;$s=$_,($a)=grep$s!~/ \Q$_
/,/\S+/g;print$a){s/^\Q$a\E\s//gm}t/!/./
|
Score: 102.50 (pass)
#!perl -ln0
for(s/^(.+) \1$/$1 /gm;$s=$_,($a)=grep$s!~/ \Q$_
/,/\S+/g;){s/^\Q$a\E (.*)/$1 /gm;print$a}t/!/\S/
|
Score: 110.49 (pass)
#!perl -p0
for(s/^(.+) \1$/$1 /gm;$s=$_,($a)=grep$s!~/ \Q$_
/,/(.+) /g;){s/^\Q$a\E (.*)/$1 /gm;s/\z/$a
/}s/\s+///!/ /
|
Score: 114.51 (pass)
Saved a stroke with for(;;) in place of while().
#!perl -p0
for(s/ (.+)/$&
$1 /g,s/^(.+) \1
//gm;$s=$_,($a)=grep$s!~/ \Q$_
/,/(.+) /g;){s/^\Q$a\E .*
//gm;s/\z/$a
/}t/!/ /
|
Score: 115.51 (pass)
Found a better way of dying.
#!perl -p0
s/ (.+)/$&
$1 /g;s/^(.+) \1
//gm;while($s=$_,($a)=grep$s!~/ \Q$_
/,/(.+) /g){s/^\Q$a\E .*
//gm;s/\z/$a
/}t/!/ /
|
Score: 117.50 (pass)
#!perl -p0
s/ (.+)/$&
$1 /g;s/^(.+) \1
//gm;while($s=$_,($a)=grep$s!~/ \Q$_
/,/(.+) /g){s/^\Q$a\E .*
//gm;s/\z/$a
/}/ /&&die
|
Score: 121.55 (fail)
Need to submit something after a whole day in last place.
#!perl -p0
s/ (.+)
/$&$1
/g;s/^(.+) \1
//gm;while(%f=/ (.+)(
)/g,($a)=grep!$f{$_},/(.+) /g){s/^\Q$a\E .*
//gm;s/$/
$a/}/ /&&die
|
Score: 121.55 (pass)
#!perl -p0
s/ (.+)/$&
$1 /g;s/^(.+) \1
//gm;while(%f=/ (.+)(
)/g,($a)=grep!$f{$_},/(.+) /g){s/^\Q$a\E .*
//gm;s/\z/$a
/}/ /&&die
|
Score: 122.55 (pass)
Had to change $ to \z to handle the new case with just "a a".
#!perl -p0
s/ (.+)
/$&$1
/g;s/^(.+) \1
//gm;while(%f=/ (.+)(
)/g,($a)=grep!$f{$_},/(.+) /g){s/^\Q$a\E .*
//gm;s/\z/$a
/}/ /&&die
|
Score: 193.38 (fail)
First version that passed. I'm submitting it despite its messiness and despite being last on the board. Maybe the score will encourage other high submissions.
#!perl -lna0
@s{@F}=();$s{$2}{$1}++while/(.+) (?!\1
)(.+)/g;for(keys%s){for$h(values%s){$h==$_ or@{$h}{keys%{$s{$_}}}=@F for keys%$h}$s{$_}{$_}&&die}print for sort{keys%{$s{$a}}<=>keys%{$s{$b}}}keys%s
|