2019-07-28から1日間の記事一覧

JuliaでProject Euler(15)

Problem 15 https://projecteuler.net/problem=15DPで解く。 function e015(N) a = zeros(Int, N+1, N+1) a[1,1] = 1 for x in 2:N+1 a[1,x] = 1 end for y in 2:N+1 a[y,1] = 1 end for y in 2:N+1 for x in 2:N+1 a[y,x] = a[y,x-1] + a[y-1,x] end end re…