2011-11-01から1ヶ月間の記事一覧

おまけ

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 …

F#での集計(部分集合写像?)パターン

seq [(2M, 1); (2M, 1); (2M, -1); (5M, 1)] |> Seq.groupBy(fun (x, y) -> x) |> Seq.map (お好きなラムダ式)