HHC 2021 Programming Contests - Surprise !
|
10-21-2021, 09:17 AM
(This post was last modified: 10-25-2021 02:08 PM by Werner.)
Post: #41
|
|||
|
|||
RE: HHC 2021 Programming Contests - Surprise !
Update 20211025: yet another correction.... hopefully the last one! 88 bytes on the 41.
Corrected version.. 42S-style listing, even shorter ;-) To catch an input of all 9's, I simply add 1 to the number at the beginning, and stop if the palindrome formed by mirroring the first half is larger or equal to the original. Code: 00 { 96-Byte Prgm } 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE |
|||
10-25-2021, 02:09 PM
Post: #42
|
|||
|
|||
RE: HHC 2021 Programming Contests - Surprise !
I had managed to shave two steps out of my earlier versions and figured that was about the best I could do, or at least maybe the best I should do so as to stop spending time on this particular challenge. I was going to update my original listings above with the slight improvement and call things good when I saw Werner's above post:
(10-21-2021 09:17 AM)Werner Wrote: To catch an input of all 9's, I simply add 1 to the number at the beginning, and stop if I find the above to be fairly brilliant. Applying this concept to my program shaved off 19 steps. Now down to 53 steps, 86 bytes. The latest and most likely greatest (for me, at least) version is below. Handles inputs greater than or equal to 0. (I would file a protest with the proper authorities if the judge used a negative number as a test case.) Code: 00 { 86-Byte Prgm } Dave - My mind is going - I can feel it. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)