solve 39 in uiua (2 min SLOW)
This commit is contained in:
22
39/main.ua
Normal file
22
39/main.ua
Normal file
@@ -0,0 +1,22 @@
|
||||
# project euler 39
|
||||
|
||||
S ← ⧻(
|
||||
⊸(▽⊸(
|
||||
=/+⊃↙₂⊣°√ ⍉
|
||||
) ⧅<3 +1⇡⌊÷2)
|
||||
▽⤚(=/+ ⍉)
|
||||
)
|
||||
|
||||
# same as S but filters in different order
|
||||
S′ ← ⧻(
|
||||
⊸(⧅<3 +1⇡⌊÷2)
|
||||
▽⤚(=/+ ⍉)
|
||||
▽⊸(=/+⊃↙₂⊣°√ ⍉)
|
||||
)
|
||||
|
||||
⊢▽⊸(=⟜/↥wait≡poolS′) +1⇡1000
|
||||
|
||||
# ⊃($new ⊙◌⍜nowS′|$old ⊙◌⍜nowS) 840
|
||||
|
||||
# it seems S' is faster on bigger numbers (roughly),
|
||||
# and it pays off here, barely.
|
||||
Reference in New Issue
Block a user