Problem:


Score : 200 points

Problem Statement

It is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers.

You are given an integer N. Find the N-th Lucas number.

Here, the i-th Lucas number L_i is defined as follows:

L_0=2

L_1=1

L_i=L_{i-1}+L_{i-2} (i≥2)

Constraints

1≤N≤86

It is guaranteed that the answer is less than 10^{18}.

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the N-th Lucas number.

Sample Input 1

5

Sample Output 1

11

L_0=2

L_1=1

L_2=L_0+L_1=3

L_3=L_1+L_2=4

L_4=L_2+L_3=7

L_5=L_3+L_4=11

Thus, the 5-th Lucas number is 11.

Sample Input 2

86

Sample Output 2

939587134549734843



Sample input:
5


Sample output:
11

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [2,1]
if n == 1:
  print(2)
elif n == 2:
  print(1)
else:
  for i in range(n-1):
    l.append(l[-1]+l[-2])
  print(l[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
L0 = 2
L1 = 1
for i in range(N-1):
  ans = L0 + L1
  L0 = L1
  L1 = ans
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=[]
s.append(2)
s.append(1)
if n==1:
    print('2')
    exit()
elif n==2:
    print('1')
    exit()
else:
    for i in range(2,87):
        k = s[i-2]+s[i-1]
        s.append(k)
        if i==n:
            print(s[i])
            exit()

Submission status: Wrong Answer

Solution code:
n=int(input())
s=[]
s.append(2)
s.append(1)
for i in range(2,87):
    k = s[i-2]+s[i-1]
    s.append(k)
    if i==n:
        print(s[i])
        exit()

Submission status: Wrong Answer

Solution code:
N = int(input())

L = [2, 1]

if N <= 2:
   print(L[N-1])
else:
   for i in range(N-1):
      L.append(L[-1] + L[-2])

print(L[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
l0 = 2
l1 = 1
sum_ = 0
for i in range(n-1):
    sum_ = l0 + l1
    l0 = l1
    l1 = sum_
print(sum_)

Submission status: Wrong Answer

Solution code:
n = int(input())
l0 = 2
l1 = 1
sum_ = 0
for i in range(1,n):
    sum_ = l0 + l1
    l0 = l1
    l1 = sum_
print(sum_)

Submission status: Wrong Answer

Solution code:
n = int(input())
l1 = 2
l2 = 1
l = 0
for i in range(n-1):
    l = l1+l2
    l1, l2 = l2, l
print(l)

Submission status: Wrong Answer

Solution code:
N=int(input())
def ryuka(n):
    if n==0:
        return 2
    elif n==1:
        return 1
    else:
        return ryuka(n-1)+ryuka(n-2)
ryuka(N)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=2
b=1
c=3
i=0
while i<n:
  d=a
  e=b
  a=b
  b=c
  c=a+b+c
  i=i+1
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
print(int(((1 + 5**(1/2)) / 2)**(n) + ((1 - 5**(1/2)) / 2)**(n)))

Submission status: Wrong Answer

Solution code:
n=int(input())

if n==1:
  print(2)
elif n==2:
  print(1)
else:
  ans=0
  num_1=2
  num_2=1
  for i in range(n-1):
    ans = num_1+num_2
    num_1,num_2 = num_2, ans
  print(ans)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':

    n = int(input())

    A = [2,1]
    if n == 1:
        print(A[1])
    else:
        for i in range(2,n+1):
            A.append(A[i-2] + A[i-1])
    print(A[n])

Submission status: Wrong Answer

Solution code:
def solve():
    N = int(input())
    L0 = 2
    L1 = 1
    if N == 1:
        print(L1)
        exit()
    Li2 = L0
    Li1 = L1
    Li = Li1 + Li2
    for _ in range(N - 2):
        Li2 = Li1
        Li1 = Li
        Li = Li1 + Li2
        print(Li)
    print(Li)

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 1:
    print(1)
a = 2
b = 1
c = 0
for i in range(n - 1):
    c = b + a
    a = b
    b = c
print(c)

Submission status: Wrong Answer

Solution code:
n= int(input())
a,b,c = 2,1,3
for i in range(n-1):
  a,b,c=b,c,b+c
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
dp = [[]for i in range(87)] 
dp[0] = 2
dp[1] = 1

for i in range(2,87):
    dp[i] = dp[i-1]+dp[i-2]
    if i == N:
        print(dp[i])
        break

Submission status: Wrong Answer

Solution code:
n = int(input())

l0 = 2
l1 = 1
l2 = 3
for i in range(n-1):
    l2 = l0 + l1
    l0, l1 = l1, l2

print(l2)

Submission status: Wrong Answer

Solution code:
n = int(input())

l0 = 2
l1 = 1
l2 = 0
for i in range(n-1):
    l2 = l0 + l1
    l0, l1 = l1, l2

print(l2)

Submission status: Wrong Answer

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]


n = int(input())

if (n == 1):
    print(1)
else:
    l1 = 1
    l2 = 3
    ans = 0
    for i in range(n-2):
        ans = l2 + l1
        l1 = l2
        l2 = ans
    print(ans)

Submission status: Wrong Answer

Solution code:
l = [2, 1]
n = int(input())
for i in range(2, n):
    l.append(l[i-1] + l[i-2])
print(l[-1] + l[-2])

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==1:
    print(2)
    exit()
elif n==2:
    print(1)
    exit()
else:
    nu1=2
    nu2=1
    for i in range(n-1):
        nu3=nu1+nu2
        nu1=nu2
        nu2=nu3
print(nu3)

Submission status: Wrong Answer

Solution code:
def luka(i):
    if i==0:
        return 2
    if i==1:
        return 1
    return luka(i-1)+luka(i-2)

print(luka(5))

Submission status: Wrong Answer

Solution code:
# ABC079 B - Lucas Number

n = int(input())
a=[2,1]
a_tes = 0

for i in range(2,n+1):
    a_tes = a[i-1] + a[i-2]
    a.append(a_tes)
print(a[n-1])

Submission status: Wrong Answer

Solution code:
s= int(input())
L0 = 2
L1 = 1
L = 0
if s ==1:
  print(L)
else:
  for i in range(2,s+1):
    L = L0 + L1
    L0 = L1
    L1 = L
print(L)

Submission status: Wrong Answer

Solution code:
s= int(input())
L0 = 2
L1 = 1
L = 0
for i in range(2,s+1):
  L = L0 + L1
  L0 = L1
  L1 = L
print(L)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=2
b=1
for _ in range(n-1):
    a,b=b,a+b
    print(a,b)
print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [2,1]
l = l + [0]*(n-1)
if n == 1:
  print(1)
for i in range(2,n+1):
  l[i] = l[i-2] + l[i-1]
print(l[n])

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 1:
    print(2)
    exit()
if N == 2:
    print(1)
    exit()
a = 2
b = 1
for i in range(2,N):
    a,b = b,a+b
print(b)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0]*(N+1)
L[0] = 2
L[1] = 1
for i in range(2,N+1):
  L[i] = L[i-1] + L[i-2]
print(L)
print(L[N])

Submission status: Wrong Answer

Solution code:
n = int(input())
l_list = [2, 1]
if n < 2 :
    print(l_list[n])
else :
    for i in range(2,n+1) :
        new = l_list[i-1] + l_list[i-2]
        l_list.append(new)
print(l_list[n])

Submission status: Wrong Answer

Solution code:
N = int(input())
R = [None] * (N+1)

R[0] = 2
if N == 0:
    print(R[0])
    exit()
R[1] =1
if N == 1:
    print(R[1])
    exit()
if N > 2:
    for i in range(2, N+1):
        R[i] = R[i-1] + R[i-2]
    print(R[N])

Submission status: Wrong Answer

Solution code:
n = int(input())
i, a, b = 2, 2, 1
ans = 0
while i <= n:
  ans = a + b
  a,b = b, ans
  i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
def calc(n):
    if n == 1:
        return 1
    elif n == 0:
        return 2
    if res[n] != 0:
        return res[n]
    tmp = calc(n-1) + calc(n-2)
    res[n] = tmp
    return tmp

N = int(input())
res = [0] * 100
calc(N)
print(res[N])

Submission status: Wrong Answer

Solution code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N = iIn()

A = [2, 1]

for i in range(N):
  var = A[i] + A[i+1]
  A.append(var)
  
print(A[i])

Submission status: Wrong Answer

Solution code:
n=int(input())
l_b=2
l=1
if n==0:
  print("2")
elif n==1:
  print("1")
else:
  for i in range(2,n):
    l_bb=l_b
    l_b=l
    l=l_b+l_bb
  print(l)

Submission status: Wrong Answer

Solution code:
n=int(input())
l_b=2
l=1
if n==1:
  print("2")
elif n==2:
  print("1")
else:
  for i in range(3,n+1):
    l_bb=l_b
    l_b=l
    l=l_b+l_bb
  print(l)

Submission status: Wrong Answer

Solution code:
n=int(input())
l_b=2
l=1
if n=="1":
  print("2")
elif n=="2":
  print("1")
else:
  for i in range(3,n+1):
    l_bb=l_b
    l_b=l
    l=l_b+l_bb
  print(l)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [2, 1]
i = 0
while i < n:
  l.append(l[-1] + l[-2])
  i+=1
print(l[n-2])

Submission status: Wrong Answer

Solution code:
n=int(input())
l0=2
l1=1
l2=0
for i in range(2,n+1):
    l2=l1+l0
    l0=l1
    l1=l2
print(l2)

Submission status: Wrong Answer

Solution code:
N=int(input())
a,b=2,1
for i in range(N):
    a,b=b,a+b
print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
l0 = 2
l1 = 1
L = 0
if n == 1:
    print(l0)
    exit()
elif n == 2:
    print(l1)
    exit()
else:
    for i in range(2, n+1):
        L = l0 + l1
        l0 = l1
        l1 = L
print(L)

Submission status: Wrong Answer

Solution code:
n = int(input())
l0 = 2
l1 = 1
L = 0
if n == 1:
    print(l0)
elif n == 2:
    print(l1)
else:
    for i in range(2, n+1):
        L = l0 + l1
        l0 = l1
        l1 = L
print(L)

Submission status: Wrong Answer

Solution code:
N = int(input())
L0 = 2
L1 = 1
if N == 1:
    print(L1)
else:
    for i in range(N-1):
        L1, L0 = L1 + L0, L1
print(L1)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n = int(input())
    list =[0]*86
    list[0]=2
    list[1]=1

    for i in range(2,86):
        list[i]=list[i-1]+list[i-2]

    if n ==86:
        print("939587134549734843")
    else:
        print(list[n-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
L = [2,1]
for i in range(n-1):
    tmp = L[i] + L[i+1]
    L.append(tmp)
print(max(L))

Submission status: Wrong Answer

Solution code:
n = int(input())

L = [2,1]
for i in range(2,n):
  k = L[i-2]+L[i-1]
  L.append(k)
  
print(L[len(L)-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [2, 1]
for i in range(N):
  L.append(L[-1]+L[-2])
print(N)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=2
b=1
if n==1:
  print(1)
for i in range(n-1):
  if i%2==0:
    a=a+b
  else:
    b=a+b
print(max(a,b))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=2
b=1
for i in range(n-1):
  if i%2==0:
    a=a+b
  else:
    b=a+b
print(max(a,b))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[2,1]
for i in range(2,n):
  a.append(a[i-1]+a[i-2])
  
print(a[n-1])

Submission status: Wrong Answer

Solution code:
N=int(input())
L_0 = 2
L_1 = 1
for i in range (N-2):
    if i%2 ==0:
        L_0 = L_0 + L_1
    else:
        L_1 = L_0 + L_1
print(L_0 + L_1)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 2:
    print(0)
elif n == 1:
    print(1)
else:
    L = [None] * 100
    L[0] = 2
    L[1] = 1
    for i in range(2, 87):
        L[i] = L[i-1] + L[i-2]
        if i == n: 
            print(L[i])
            exit()

Submission status: Wrong Answer

Solution code:
N = int(input())
tmp2 = 2
tmp1 = 1
ans = 0

for i in range(2,N+1):
  ans = tmp2 + tmp1
  tmp2 = tmp1
  tmp1 = ans
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
L1 = 2
L2 = 1
L3 = 3
if N == 1:
    print(L1)
elif N == 2:
    print(L2)
else:
    for i in range(N-2):
        L1 = L3
        L3 += L2
        L2 = L1
    print(L3)

Submission status: Wrong Answer

Solution code:
n = int(input())
memo = [2, 1]
if n <= 2:
    print(memo[n-1])
    exit()
else:
    for i in range(2,n):
        tmp = memo[1]
        memo[1] = memo[0] + tmp
        memo[0] = tmp

print(memo[1])

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
  print(1)
  exit()

L = [0]*(N+1)
for i in range(2, N+1):
  L[i] = L[i-1] + L[i-2]

print(L[N])

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [2,1]
if n>2:
    for i in range(n-1):
        l.append(l[i]+l[i+1])
print(l[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
l0 = 2
l1 = 1
l = 0
for i in range(2, n + 1):
    l = l1 + l0
    l0 = l1
    l1 = l
print(l)

Submission status: Wrong Answer

Solution code:
n = int(input())

l = [0] * 100
l[0] = 2
l[1] = 1

if n == 0 or n == 1:
    print(l[0])
if n>=2:
    for i in range(2, n+1):
        l[i] = l[i-1] + l[i-2]
    print(l[n])

Submission status: Wrong Answer

Solution code:
n = int(input())
l0=2
l1 = 1
l = l0 + l1
for i in range(n-2):
    l0 = l1
    l1 = l
    l = l0 + l1
if l==1:
  print(l1)
else:
  print(l)

Submission status: Wrong Answer

Solution code:
n=int(input())
lo=2
li=1
cou=0
import sys
if n==1:
    print(1)
if n==2:
    print(3)
    sys.exit()

for  i in range(n-1):

    cou=lo+li
    lo=li
    li=cou
   

print(cou)

Submission status: Wrong Answer

Solution code:
n=int(input())
lo=2
li=1
cou=0
if n==1:
    print(2)
if n==2:
    print(1)
for  i in range(n-1):

    cou=lo+li
    lo=li
    li=cou
   
    
print(cou)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools

n = int(input())
lucas = [
    1,
    3,
    4,
    7,
    11,
    18,
    29,
    47,
    76,
    123,
    199,
    322,
    521,
    843,
    1364,
    2207,
    3571,
    5778,
    9349,
    15127,
    24476,
    39603,
    64079,
    103682,
    167761,
    271443,
    439204,
    710647,
    1149851,
    1860498,
    3010349,
    4870847,
    7881196,
    12752043,
    20633239,
    33385282,
    54018521,
    87403803,
    141422324,
    228826127,
    370248451,
    599074578,
    969323029,
    1568397607,
    2537720636,
    4106118243,
    6643838879,
    10749957122,
    17393796001,
    28143753123,
    45537549124,
    73681302247,
    119218851371,
    192900153618,
    312119004989,
    505019158607,
    817138163596,
    1322157322203,
    2139295485799,
    3461452808002,
    5600748293801,
    9062201101803,
    14662949395604,
    23725150497407,
    38388099893011,
    62113250390418,
    100501350283429,
    162614600673847,
    263115950957276,
    425730551631123,
    688846502588399,
    1114577054219522,
    1803423556807921,
    2918000611027443,
    4721424167835364,
    7639424778862807,
    12360848946698171,
    20000273725560978,
    32361122672259149,
    52361396397820127,
    84722519070079276,
    137083915467899403,
    221806434537978679,
    358890350005878082,
    784543856761,
    939587134549734843,
]
print(lucas[n-1])

Submission status: Wrong Answer

Solution code:
n=int(input())

a=2
b=1

if n==1:
  n=2

for i in range(n-1):
  nn = a+b
  ans=nn
  a=b
  b=nn

if n==1:
  ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

a=2
b=1

if n==1:
  n=2

for i in range(n-1):
  nn = a+b
  ans=nn
  a=b
  b=nn

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools

n = int(input())
l0=2
l1 = 1
l = l0 + l1
for i in range(n-2):
    l0 = l1
    l1 = l
    l = l0 + l1
if n == 1:
    l = 2
elif n == 2:
    l = 1
    
print(l)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools

n = int(input())
l0=2
l1 = 1
l = l0 + l1
for i in range(n-2):
    l0 = l1
    l1 = l
    l = l0 + l1
print(l)

Submission status: Wrong Answer

Solution code:
n = int(input())
l1 = 2
l2 = 1
l3 = l2 + l1

if n == 1:
    print(l1)
elif n == 2:
    print(l2)
else:
    for i in range(n - 2):
        l1 = l2
        l2 = l3
        l3 = l2 + l1
    print(l3)

Submission status: Wrong Answer

Solution code:
n = int(input())
l1 = 2
l2 = 1
l3 = l2 + l1

for i in range(n - 2):
    l1 = l2
    l2 = l3
    l3 = l2 + l1


print(l3)

Submission status: Wrong Answer

Solution code:
n = int(input())

l0 = 2
l1 = 1
if n==1:
    print(l1)
ans = 0
for i in range(n - 1):
    ans = l0 + l1
    l0 = l1
    l1 = ans

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

l0 = 2
l1 = 1
ans = 0
for i in range(n - 1):
    ans = l0 + l1
    l0 = l1
    l1 = ans

print(ans)

Submission status: Wrong Answer

Solution code:
i = int(input())
luca = [2,1,3]
for l in range(i-2):
	num = luca[-1]+luca[-2]
	luca.append(num)
print(luca[-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
a=2
b=1
for i in range(n-1):
  a,b=b,(a+b)
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
A =[2,1]
if N <= 2:
    print(A[N-1])
    exit()
for i in range(2,N+1):
    A.append(A[i-1]+A[i-2])
print(A[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
A =[2,1]
if N <= 2:
    print(A[N-1])
    exit()
for i in range(2,N):
    A.append(A[i-1]+A[i-2])
print(A[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [2,1]
if n<=2:
    print(l[n-1])
else:
    c = 2
    while(c<=n):
        l.append(sum(l[-2:]))
        c+=1
    print(l[-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
first=1
second=3
for i in range(n-2):
    ans=first+second
    first=second
    second=ans
print(ans if n>3 else "1" if n==1 else "3")

Submission status: Wrong Answer

Solution code:
n = int(input())
l0 = 2
l1 = 1
for i in range(n-1):
  sum = l0+l1
  l0 = l1
  l1 = sum
print(sum)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[2,1]
for i in range(n-2):
  a+=[sum(a[-2:])]
print(a[n-1])

Submission status: Wrong Answer

Solution code:

import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    a=2
    b=1
    num=0
    for i in range(n-1):
       num=a+b
       a,b=b,a+b
    print(num)
resolve()

Submission status: Wrong Answer

Solution code:
N = int(input())

Li_2 = 2
Li_1 = 1
Li = Li_2 + Li_1
for i in range(N-1):
    Li = Li_2 + Li_1
    Li_2 = Li_1
    Li_1 = Li


print(Li)

Submission status: Wrong Answer

Solution code:
lu = [2, 1]
x = int(input())
for i in range(2, x):
    lu.append(lu[i-1] + lu[i - 2])  
print(lu[x-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
l0 = 2
l1 = 1
cnt = 2
l2 = l0 + l1
while cnt < n:
    l2, l1, l0 = l2 + l1, l2, l1
    cnt += 1
print(l2)

Submission status: Wrong Answer

Solution code:
n = int(input())
L = [2,1]
if n == 1:
  print(L[1])
else:
  for i in range(2,n+1):
    l = L[i-2] + L[i-1]
    L.append(l)
print(L[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
L = [0 for _ in range(n+2)]
L[0]=2
L[1]=1
if n > 2:
    for i in range(2,n+1):
        L[i] = L[i-1]+L[i-2]
print(L[n])

Submission status: Wrong Answer

Solution code:
t=[1,0]
for i in range(2,90):
  t.append(t[i-1]+t[i-2])
print(t[int(input())])

Submission status: Wrong Answer

Solution code:
t=[0,1]
for i in range(2,90):
  t.append(t[i-1]+t[i-2])
print(t[int(input())])

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [2,1]

if n == 1:
  print(2)
  exit()

for _ in range(n-2):
  ans.append(ans[-1]+ans[-2])
  
print(ans[-1])

Submission status: Wrong Answer

Solution code:
N=int(input())
N=N+1
L1 = 2
L2 = 1
if N==1:print(L1)
if N==2:print(L2)
if N>3:
  N=N-2
  for i in range(N):
    L=L1+L2
    L1 = L2
    L2 = L
  print(L)

Submission status: Wrong Answer

Solution code:
N=int(input())
L1 = 2
L2 = 1
if N==1:print(L1)
if N==2:print(L2)
if N>3:
  N=N-2
  for i in range(N):
    L=L1+L2
    L1 = L2
    L2 = L
  print(L)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 2
y = 1

if n == 1:
    ans = 2

if n == 2:
    ans = 1

for i in range(n-1):
    ans = x + y
    x = y
    y = ans

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 2
y = 1

if n == 1:
    print(2)
    exit()

if n == 2:
    print(1)
    exit()

for i in range(n-1):
    ans = x + y
    x = y
    y = ans

print(ans)

Submission status: Wrong Answer

Solution code:
def Lucas(L1,L2,n,end):
   if(n==end):
      print(L1+L2)
   else:
      Lucas(L1+L2,L1,n+1,end)
def myAnswer(N:int) -> None:
   if(N == 0):
      return 2
   elif(N == 1):
      return 1
   else:
      Lucas(1,2,2,N)
   

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   myAnswer(N)

if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:
# ABC 079: B – Lucas Number
n = int(input())

L0 = 2
L1 = 1
L = L0 + L1

for _ in range(n - 2):
    L0 = L1
    L1 = L
    L = L0 + L1

print(L)

Submission status: Wrong Answer

Solution code:
n = int(input())
memo = [-1]*(n+1)

def func(i):
    if i == 0:
        return 2
    if i == 1:
        return 1
    
    if memo[i] != -1:
        return memo[i]
    
    memo[i] = func(i-2) + func(i-1)
    return memo[i]

func(n)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0]*(N+2)
L[0] = 2
L[1] = 1
if N<=2:
    print(L[N])
else:
    for i in range(2,N+1):
        L[i] = L[i-1]+L[i-2]
    print(L[N])

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0]*(N+1)
L[0] = 2
L[1] = 1
if N<=2:
    print(L[N-1])
    exit()
for i in range(2,N+1):
    L[i] = L[i-1]+L[i-2]
print(L[N])

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0]*(N+2)
L[0] = 2
L[1] = 1
if N<=2:
    print(L[N-1])
else:
    for i in range(2,N+1):
        L[i] = L[i-1]+L[i-2]
    print(L[N])

Submission status: Wrong Answer

Solution code:
n = int(input())

l = [2,1]
for i in range(n):
    l.append(l[-1]+l[-2])

print(l[n-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [2, 1]
for _ in range(n):
    k = l[-1] + l[-2]
    l.append(k)

print(l[n-1])

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = [2, 1]
for n in range(2,N):
  ans.append(ans[n-1]+ans[n-2])

Submission status: Wrong Answer

Solution code:
N = int(input())

L = [2,1]

if N < 3:
    ans = L[N-1]
else:
    old_L = L[0]
    new_L = L[1]
    for _ in range(1, N):
        tmp = old_L + new_L
        old_L = new_L
        new_L = tmp
    ans = new_L

print(ans)

Submission status: Wrong Answer

Solution code:
print([2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204,710647,1149851,1860498,3010349,4870847,7881196,12752043,20633239,33385282,54018521,87403803,141422324,228826127,370248451,599074578,969323029,1568397607,2537720636,4106118243,6643838879,10749957122,17393796001,28143753123,45537549124,73681302247,119218851371,192900153618,312119004989,505019158607,817138163596,1322157322203,2139295485799,3461452808002,5600748293801,9062201101803,14662949395604,23725150497407,38388099893011,62113250390418,100501350283429,162614600673847,263115950957276,425730551631123,688846502588399,1114577054219522,1803423556807921,2918000611027443,4721424167835364,7639424778862807,12360848946698171,20000273725560978,32361122672259149,52361396397820127,84722519070079276,137083915467899403,221806434537978679,358890350005878082,580696784543856761][int(input())-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
L0 = 2
L1 = 1
if N == 1:
  print(L1)
for i in range(2, N + 1):
  L0, L1 = L1, L0 + L1
print(L1)

Submission status: Wrong Answer

Solution code:
n=int(input())
a,b=2,1
for i in range(n-1):
  a,b=b,(a+b)
print(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
l0=2
l1=1
l2=0
ans=0

for i in range(1,n):
  if i%3==1:
    l2=l0+l1
    ans=l2
  
  elif i%3==2:
    l0=l1+l2
    ans=l0
    
  else:
    l1=l0+l2
    ans=l1
    
print(ans)

Submission status: Wrong Answer

Solution code:

import math
import itertools
import statistics
#import numpy as np
import collections

n = int(input())
#a, b, x = list(map(int, input().split()))

l = [2, 1]

if n==1:
    print(1)
else:
    for i in range(2, n+1):
        l.append(l[i-1]+l[i-2])

print(l[-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[2,1]
for i in range(n):
    l.append(l[-1]+l[-2])
print(l[n-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[1,2]
for i in range(n):
    l.append(l[-1]+l[-2])
print(l[n-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
l1=2
l2=1
if n==1:
  print(l1)
  exit()
for i in range(n-2):
  if i%2==0:
    l1=l1+l2
  else:
    l2=l1+l2
print(l1+l2)

Submission status: Wrong Answer

Solution code:
n=int(input())
l1=2
l2=1
for i in range(n-2):
  if i%2==0:
    l1=l1+l2
  else:
    l2=l1+l2
print(l1+l2)

Submission status: Wrong Answer

Solution code:
def lucas(n) : 
      
    # Base cases  
    if (n == 0) : 
        return 2
    if (n == 1) : 
        return 1
  
    # recurrence relation  
    return lucas(n - 1) + lucas(n - 2)

Submission status: Wrong Answer

Solution code:

if __name__ == '__main__':
    tmp = int(input())
    l = [2, 1]
    ans = 0
    if tmp < 2:
        ans = l[tmp - 1]
        print(ans)
        exit()
    for i in range(tmp - 1):
        ans = l[i] + l[i + 1]
        l.append(ans)
    print(ans)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    tmp = int(input())
    l = [2, 1]
    ans = 0
    for i in range(tmp - 1):
        ans = l[i] + l[i + 1]
        l.append(ans)
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys

l=[0]*100
l[0]=2
l[1]=1

n=int(input())

for i in range(2,100):
  l[i]=l[i-2]+l[i-1]
  if i==n:
    print(l[i])
    sys.exit()

Submission status: Wrong Answer

Solution code:
a = int(input())
d =0
if a ==1:
  print(2)
elif a==2:
  print(1)
else:
  b,c =2,1
  for i in range(3,a+2):
    d =b+c
    b,c =c,d
  print(d)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
l.append(2)
l.append(1)
if n==1:
    print(n)
    exit()
for i in range(2,n+1):
    l.append(l[i-2]+l[i-1])
    print(i,l[i])
    if n==i:
        print(l[i])
        exit()

Submission status: Wrong Answer

Solution code:
N = int(input())
l = [2, 1]
i = 2
ans =0
if N ==2:
    ans =3
while i < N +1:
    l.append(str(int(l[i-1]) + int(l[i-2])))
    ans = l[i]
    i = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = [2, 1]
i = 2
ans =0
if N ==2:
    print(3)
while i < N +1:
    l.append(str(int(l[i-1]) + int(l[i-2])))
    ans = l[i]
    i = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = [2, 1]
i = 2
ans =0
if N ==2:
    print(1)
while i < N +1:
    l.append(str(int(l[i-1]) + int(l[i-2])))
    ans = l[i]
    i = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = [2, 1]
i = 2
ans =0
if N ==1:
    print(1)
while i < N +1:
    l.append(str(int(l[i-1]) + int(l[i-2])))
    ans = l[i]
    i = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = [2, 1]
i = 2
ans =0
while i < N +1:
    l.append(str(int(l[i-1]) + int(l[i-2])))
    ans = l[i]
    i = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
L = [2,1]
N = int(input())
K = 0
if N == 1:
  print(1)
else:
  for i in range(N-1):
    K = L[i+1]+L[i]
    L.append(K)
print(K)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = 2
b = 1
c = 0
if n == 1:
    print(2)
elif n == 2:
    print(1)
else:
    for i in range(2, n + 1):
        c = a + b
        a = b
        b = c
    print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = 2
b = 1
c = 0
for i in range(2, n + 1):
    c = a + b
    a = b
    b = c
print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [0] * (n + 1)
l[0] = 2
l[1] = 1
if n == 1:
    print(1)
else:
    for i in range(2, n + 1):
        l[i] = l[i - 1] + l[i - 2]
print(l[n])

Submission status: Wrong Answer

Solution code:
N = int(input())
L_0 = 2
L_1 = 1
cur = 0
for i in range(N):
    if i==0:
        cur = L_0
    elif i==1:
        prev = L_1
        cur += L_1 
    else:
        tmp = cur
        cur += prev
        prev = tmp
print(cur)

Submission status: Wrong Answer

Solution code:
l = [0,1]
n = int(input())
for i in range(2,n+1):
    l.append(l[i-1] + l[i-2])
print(l[-1])

Submission status: Wrong Answer

Solution code:
a,b=2,1
n = int(input())
if n>=2:
    for i in range(n):
        a,b=b,a+b
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

L0 = 2
L1 = 1

if N == 1:
  ans = L0
elif N == 2:
  ans = L1
else:
  prepre = L0
  pre = L1
  ans=0
  for n in range(2,N+1):
    ans = prepre + pre
    prepre = pre
    pre = ans

print(ans)

Submission status: Wrong Answer

Solution code:
l=[2,1]
n=int(input())
i=0
while i!=n:
  l.append(l[i]+l[i+1])
  i+=1
print(l[n-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 2
y = 1
if n==1:
    print(2)
elif n==2:
    print(1)
else:
    for i in range(n-1):
        l = x+y
        x = y
        y = l
    print(l)

Submission status: Wrong Answer

Solution code:
n = int( input())

a = [2,1] + [0]*(86-1)

print(len(a))
for i in range(2,87) :
  a[i] =a[i-1]+a[i-2]

print(a[n])

Submission status: Wrong Answer

Solution code:
n = int(input())

l = 2
a = [2]

for i in range(1, n+1):
    if i == 1:
        a.append(1)
    else:
        l = sum(a)
        a.pop(0)
        a.append(l)

print(l)

Submission status: Wrong Answer

Solution code:
n = int(input())
def luc(a, b, n):
    if n > 0:
        print(a,b)
        return luc(b,a+b,n-1)
    else:
        return a
print(luc(2,1,n))

Submission status: Wrong Answer

Solution code:
n = int(input())
li1 = 1
li2 = 2
luca = 0
for i in range(n-1):
    luca = li1 + li2
    li2 = li1
    li1 = luca
print(luca)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [2,1]
for i in range(2,n):
  a = l[-1]+l[-2]
  l.append(a)
print(l[-1])

Submission status: Wrong Answer

Solution code:
import sys

n=int(input())
list=[]
sum=0
list.append(2)
list.append(1)
for i in range(2,87):
	list.append(list[i-1]+list[i-2])
	if n==i:
		print(list[-1])
		sys.exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 1:
    print(2)
else:
    a=2
    b=1
    for i in range(n-1):
        a, b = b, (a+b)
    print(b)

Submission status: Wrong Answer

Solution code:
N=int(input())
x0=2
x1=1

x=0

if N==1:
    x=2
elif N==2:
    x=1
else:
    for i in range(N-1):
        x=x1+x0
        x0=x1
        x1=x

print(x)

Submission status: Wrong Answer

Solution code:
n = int(input())

l0 = 2
l1 = 1
result = 0
for i in range(n-1):
  result = l0+l1
  l0 = l1
  l1 = result

print(result)

Submission status: Wrong Answer

Solution code:
n=int(input())
k,l=2,1
for i in range(n-1):
    k,l=k+l,k
print(l)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0] * 90
L[0], L[1] = 2, 1
for i in range(2, len(L)):
    L[i] = int(L[i - 1]) + int(L[i - 2])
print(L)
print(int(L[N]))