solve 39 in uiua (2 min SLOW)

This commit is contained in:
2025-10-04 09:41:02 +02:00
parent 77e130099a
commit 0e51ddd620

22
39/main.ua Normal file
View 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.