Front page | perl.fwp |
Postings from March 2002
Re: TPR1 post-mortem
Thread Previous
|
Thread Next
From:
Adam Spiers
Date:
March 8, 2002 05:49
Subject:
Re: TPR1 post-mortem
Message ID:
20020308134919.A13748@corelli.new.ox.ac.uk
Marcelo E. Magallon (marcelo.magallon@bigfoot.com) wrote:
> Regarding my "one step" solution, the secret can be computed as:
>
> Op(i=1..digits, C(i, digits)*digit[i])
>
> where Op(a,b) := (0, 1..9, 1..9, ...)[a+b] and C(i, j) := j!/i!/(j-i)!
> (or something like that, I can't think straight right now). This lead
> to a horribly long solution that doesn't even pass the test program :-)
"One step" for very unusual bindings of "one" ;-)
I also thought of this. However you can avoid messing around with
factorials by simply extracting digits from the powers of 11.
I'm just gutted that I had considered *1.1 and then rejected it as
being too much hassle to remove the two outer digits. If only I'd
realised I could have done that in 3 extra characters!
Ah well. At least mine was the best entry did the magic op, the pop,
and removal of the trailing digit all within one s///ge. Small
comfort ...
Thread Previous
|
Thread Next