|
|
|
@ -0,0 +1,15 @@
|
|
|
|
|
$ Time: 7 15 30
|
|
|
|
|
$ Distance: 9 40 200
|
|
|
|
|
TestInput ←
|
|
|
|
|
|
|
|
|
|
Quadratic ← ⊃+-⊃(⍜⍘√+|∘)⊃(¯÷×2|¯÷⊙⋅∘)
|
|
|
|
|
|
|
|
|
|
Solve ← -1-:⊓⌈⌊ Quadratic ¯1 ⊙¯
|
|
|
|
|
PartI ← /× Solve ≡⍘⊟ ⍉⊜(⊜parse≠@ .↘9)≠@\n.
|
|
|
|
|
PartII ← Solve ⍘⊟ ⍉⊜(parse▽≠@ .↘9)≠@\n.
|
|
|
|
|
|
|
|
|
|
PartI TestInput
|
|
|
|
|
PartII TestInput
|
|
|
|
|
|
|
|
|
|
PartI &fras "day06.in"
|
|
|
|
|
PartII &fras "day06.in"
|