92/uiua: even faster with chunked threading and memoization
This commit is contained in:
10
92/main.ua
10
92/main.ua
@@ -1,7 +1,5 @@
|
||||
# next number in chain
|
||||
N ← /+⍉°√⊥10
|
||||
N ← memo(/+⍉°√⊥10) # memoize, because we get many repeated 1s
|
||||
|
||||
⍜-⇡1 1e7
|
||||
⍥N10 # the longest 1-chain is less than 10
|
||||
-⊙1e7 ⧻⊚=1 # count 1s to subtract from 1e7
|
||||
-1 # there are 999999 nums, because no 0
|
||||
°△ 1e4_1e3 # chunk the input
|
||||
wait≡pool⍥₁₀N # thread each chunk of size 1e3
|
||||
-⊃(⧻⊚=1|-₁⧻♭)
|
||||
|
||||
Reference in New Issue
Block a user