本当は怖いHPC

HPC屋の趣味&実益ブログ

2010-12-08から1日間の記事一覧

Project Euler Problem 25

1000桁を超える最初のfibonacci数は何個目か?安直に。 target_len = 1000 fib = [1,1,2] index = 3 while len(str(fib[2])) < target_len: index += 1 fib = [fib[1], fib[2], fib[1] + fib[2]] if len(str(fib[2])) >= target_len: print index break …

Project Euler Problem 24

しばらく放置していたのを微妙に再開。Problem 024。問題は、 What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?ということである。0〜9の10個の数字の順列を辞書順に並べ替えたときに、100万個目の文字…

【広告】