Tuesday 22 January 2013

10676. 0110SS Problem code: IWGBS

N=input()
A=[0,1]
B = [0,1]
i = 2
while i<=N:
    A.append(A[i-1]+B[i-1])
    B.append(A[i-1])
    i +=1
print A[N]+B[N]

No comments:

Post a Comment