2014-05-13から1日間の記事一覧

Project Euler その14

Problem18 By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom …

Project Euler その13

Problem15 Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner. How many such routes are there through a 20×20 grid? 訳 2x2の格子の左上の隅…

Clojure演習 ライブラリ書いてみた-2

memoize 前回こんなコードを書いていた。 (defn get-content [c sm] (let [rdr ((memoize get-data) sm)] (assoc {} c (first (:content (first (html/select (html/html-resource rdr) [c]))))) )) これでキャッシュされると思っていたらしい。アホか。 (de…