2011-07-20から1日間の記事一覧

Project Eueler: problem14

問題 The following iterative sequence is defined for the set of positive integers:n n/2 (n is even) n 3n + 1 (n is odd)Using the rule above and starting with 13, we generate the following sequence:13 40 20 10 5 16 8 4 2 1 It can be seen th…

Project Eueler: problem15

問題 Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner. How many routes are there through a 2020 grid? 回答 def root(x,y,c) cnt = 0 return c[x][y] if c[x][y] return cnt += 1 …