おまけ
Project Eular Problem 15
分割統治法、再帰と動的計画法、メモ化の組み合わせのパターン
let mutable maxMemo = 256 // 257*257*sizeof(bigint) bigintは可変長 let routeMemo = Array2D.create (maxMemo + 1) (maxMemo + 1) 0I let rec route x y = let a = routeMemo.[x, y] match a = 0I with | false -> a | true -> let ans = match x > 0 with | true -> match y > 0 with | true -> route (x - 1) y + route x (y - 1) | false -> route (x - 1) 0 // 1に決まってるけどw | false -> match y > 0 with | true -> route (y - 1) 0 // まあ1 | false -> 1I routeMemo.[x, y] <- ans ans let solve px py = route px py let run () = solve 20 20