11922 - Permutation Transformer

All about problems in Volume 119. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
rujialiu
New poster
Posts: 37
Joined: Mon Mar 05, 2007 2:42 am

11922 - Permutation Transformer

Post by rujialiu »

I'm making this problem for educational purpose. So here are the 2 methods used by me (method 1) and Derek Kisman (method2). Method 1 is theoretically faster, but given the limitations of the problem, both programs run very fast. He hints are encoded by rot13, so you won't be able to see them "accidentally" :)

Method 1 (code length: 2.29k):

Hfr n fcynl gerr. Urer gur abqr jrvtug pbeerfcbaqf gb gur cbfvgvba bs rnpu ahzore. Znvagnva gur ahzore bs abqrf va rnpu fhogerr, gura lbh pna ebgngr gur x-gu ryrzrag gb gur ebbg (pnyy vg fcynl-xgu). Lbh nyfb arrq gb znvagnva jurgure be abg rnpu fhogerr vf erirefrq.

Gvzr pbzcyrkvgl: B(z*ybta)

Method 2 (code length: 1.87k):

Qvivqr gur neenl vagb Q=fdeg(a) fhoneenlf, gura rnpu bcrengvba vaibyirf fbzr jubyr fhoneenlf, nf jryy nf vaqvivqhny ryrzragf va ng zbfg gjb fhoneenlf (urnq/gnvy)

Gvzr pbzcyrkvgl: B(z*fdeg(a))
:-)
Post Reply

Return to “Volume 119 (11900-11999)”