Thursday, May 23, 2013

11931. AMZ Word

http://www.spoj.com/problems/AMZSEQ/
lst = [0] * 25
lst[0] = 1
lst[1] = 3
for i in range(2, 25):
    lst[i] = 2 * lst[i - 1] + lst[i - 2]
n = input()
print lst[n]

No comments:

Post a Comment