Solve problem 2
This commit is contained in:
parent
9628a7a04b
commit
2807421031
1 changed files with 10 additions and 2 deletions
|
@ -25,8 +25,16 @@
|
||||||
|
|
||||||
∇ steps←{p}Steps fromTo
|
∇ steps←{p}Steps fromTo
|
||||||
⍝ 2020 APL Problem Solving Competition Phase II
|
⍝ 2020 APL Problem Solving Competition Phase II
|
||||||
⍝ Stub function for Problem 2, Task 1 - Steps
|
⍝ Problem 2, Task 1 - Steps
|
||||||
⍝ Put your code and comments below here
|
:If 0=⎕NC'p' ⍝ No left argument: same as Problem 5 of Phase I
|
||||||
|
steps←{(⊃⍵)+(-×-/⍵)×0,⍳|-/⍵}fromTo
|
||||||
|
:ElseIf p<0
|
||||||
|
steps←(-⌊p){(⊃⍵)+(-×-/⍵)×0,(⍳⍺)×|-/⍵÷⍺}fromTo
|
||||||
|
:ElseIf p>0
|
||||||
|
steps←p{(⊃⍵)+(-×-/⍵)×(|-/⍵)⌊⍺×0,⍳⌈(|-/⍵)÷⍺}fromTo
|
||||||
|
:ElseIf p=0
|
||||||
|
steps←⊃fromTo
|
||||||
|
:EndIf
|
||||||
∇
|
∇
|
||||||
|
|
||||||
∇ urls←PastTasks url;r;paths
|
∇ urls←PastTasks url;r;paths
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue