From 30eeae6fbbec1286060aa762b1e7e548e51ccf72 Mon Sep 17 00:00:00 2001 From: Dimitri Lozeve Date: Sat, 9 May 2020 18:06:51 +0200 Subject: [PATCH] Solve problem 1 from phase 2 --- Contest2020/Contest2020.dyalog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Contest2020/Contest2020.dyalog b/Contest2020/Contest2020.dyalog index df7a6e7..f29a708 100644 --- a/Contest2020/Contest2020.dyalog +++ b/Contest2020/Contest2020.dyalog @@ -14,6 +14,14 @@ ⍝ 2020 APL Problem Solving Competition Phase II ⍝ Stub function for Problem 1, Task 1 - DiveScore ⍝ Put your code and comments below here + :If 7=≢scores + scores←scores[¯2↓2↓⍋scores] + :ElseIf 5=≢scores + scores←scores[¯1↓1↓⍋scores] + :Else + scores←scores + :EndIf + score←2(⍎⍕)dd×+/scores ∇ ∇ steps←{p}Steps fromTo