2013-01-30から1日間の記事一覧
scala> (21 to 40).product / (1 to 20).product res0: Int = 0 scala> (BigInt(21) to 40).product / (BigInt(1) to 20).product res1: scala.math.BigInt = 137846528820
> ([21..40] |> List.reduce(*)) / ([1..20] |> List.reduce(*)) - ;; val it : int = 0 > ([21I..40I] |> List.reduce(*)) / ([1I..20I] |> List.reduce(*)) - ;; val it : System.Numerics.BigInteger = 137846528820I
格子経路2×2 のマス目の左上からスタートした場合, 引き返しなしで右下にいくルートは 6 つある.では, 20×20 のマス目ではいくつのルートがあるか.http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%2015Lattice pathsStarting in the …