Project Euler Problem 48
問題
The series, 1^1 + 2^2 + 3^3 + ... + 10^10 = 10405071317. Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000.
ソース
puts (1..1000).inject(0){|s, i| s + i**i} % (10 ** 10)
解答
9110846700
感想
ここまで来て1行プログラムとは、Rubyすごすぎです!