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: Accepted

Solution code:
# -*- coding: utf-8 -*-

if __name__ == '__main__':
    N = input()
    n0 = 2
    n1 = 1
    if N == 1:
        print(1)
    else:    
        now = 1
        while now != N:
            n = n0 + n1
            n0 = n1
            n1 = n
            now += 1
        print(n)

Submission status: Accepted

Solution code:
#http://abc079.contest.atcoder.jp/
# -*- coding: utf-8 -*-
import sys

n = int(input())

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

print(max(ryuka))

Submission status: Accepted

Solution code:
a = [2,1,3]
count  = 3
while(count < 87):
    a.append(a[count-1]+a[count-2])
    count += 1
N=input()
print(a[int(N)])

Submission status: Accepted

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

while len(L) < n+1:
    L.append(L[len(L)-1]+L[len(L)-2])

print(L[n])

Submission status: Accepted

Solution code:
def main():
    N = int(input())

    print(f(N))


def f(N):
    a, b = 2, 1
    for i in range(2, N + 1):
        a, b = b, a + b

    return b

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

array = []
array.append(2)
array.append(1)
for i in range(85):
    array.append(array[i] + array[i+1])

N = int(sys.stdin.readline().strip())

print(array[N])

Submission status: Accepted

Solution code:
def luca(n):
    if lucas[n] != 0:
        return lucas[n]
    else:
        lucas[n] = luca(n-1) + luca(n-2)
        return lucas[n]

n = int(input())

lucas = [0 for x in range(n+1)]
lucas[0] = 2
lucas[1] = 1

if n >= 2:
    print(luca(n))
else:
    print(luca(n))

Submission status: Accepted

Solution code:
n=int(input())

a=[]
a.append(2)
a.append(1)

if n==1:
    print(1)
elif n==2:
    print(3) 
else:    
    for i in range(n-1):
        a.append(a[0]+a[1])
        del a[0]
    print(a[1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

L = [0 for i in range(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[N])

Submission status: Accepted

Solution code:
def main():
	n = int(input())

	dp=[0 for i in range(n+1)]
	dp[0]=2
	dp[1]=1
	for i in range(2,n+1):
		dp[i] = dp[i-1]+dp[i-2]
	print(dp[n])
	
if __name__ == "__main__": main()

Submission status: Accepted

Solution code:

n = int(input())
l0 = 2
l1 = 1

for i in range(1, n):
    tmp = l1
    l1 += l0
    l0 = tmp
print(l1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bim/python
#! -*- coding: utf-8 -*-

n = raw_input()
n = int(n)

b2 = 2
b1 = 1

if n == 1:
    a = 1
else:
    for i in range(n-1):
        a = b1 + b2
        b2 = b1
        b1 = a
        #print i+2, a

print a

Submission status: Accepted

Solution code:
n = int(raw_input())

l = [2,1]

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

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

print l[-1]

Submission status: Accepted

Solution code:
a=int(input())
l0=2
l1=1

if a==1:
  print(1)
else:
    for i in range(a-1):
        l2 = l1 + l0
        l0 = l1 
        l1 = l2
    print(l2)

Submission status: Accepted

Solution code:
n=int(input())

num=[2,1]

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

Submission status: Accepted

Solution code:
n = int(input())
a = [None for i in range(87)]
a[0] = 2
a[1] = 1

def calc(N):
    if a[N]:
        return a[N]
    elif a[N-1] and a[N-2]:
        a[N] = a[N-1] + a[N-2]
        return a[N]
    else:
        a[N] = calc(N-1) + calc(N-2)
        return a[N]

print (calc(n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    if N == 1:
        return 1
    else:
        lucas = []
        lucas.append(2)
        lucas.append(1)
        for i in range(1, N):
            lucas.append(lucas[-1]+lucas[-2])
        return lucas[-1]

if __name__ == "__main__":
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
N = int(input())
memo = [-1 for _ in range(N+1)]
def lucas(N):
    global memo
    if N==0:
        memo[0] = 2
        return 2
    if N==1:
        memo[1] = 1
        return 1
    if(memo[N]>0):
        return memo[N]
    else:
        memo[N] = lucas(N-1) + lucas(N-2)
        return memo[N]


print(lucas(N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
dp = [-1]*87

def func(n):

    if dp[n] != -1:
        return dp[n]

    dp[n] = func(n-1) + func(n-2)
    return dp[n]


dp[0] = 2
dp[1] = 1

num = int(input())
print(func(num))

Submission status: Accepted

Solution code:
N = int(input())

L = [0 for i in range(87)]
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: Accepted

Solution code:
# python3
# utf-8

n = int(input())

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

Submission status: Accepted

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

    print(L[-1])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline().strip())

def L(i, cache={}):
    if i == 0:
        return 2
    if i == 1:
        return 1
    if i >= 2:
        if i in cache:
            return cache[i]
        r = L(i-2) + L(i-1)
        cache[i] = r
        return r

print(L(N))

Submission status: Accepted

Solution code:
N = int(input())

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

print(Ls[N])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = [None] * 100
L[0] = 2
L[1] = 1

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

print(L[N])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import lru_cache
@lru_cache(maxsize=1000)
def Lucas(N):
    if N == 0:
        return 2
    elif N == 1:
        return 1
    else:
        return Lucas(N-1) + Lucas(N-2)
N = int(input())
print(Lucas(N))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

n = int(input())

l = [0 for i in range(100)]
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: Accepted

Solution code:
N = int(input()) + 1

memo = [0] * N
for i in range(N):
  if i == 0:
    memo[i] = 2
  elif i == 1:
    memo[i] = 1
  else:
    memo[i] = memo[i-1] + memo[i-2]

print(memo[N-1])

Submission status: Accepted

Solution code:
N = int(input())
luka = [2,1]

for i in range(2,N+1):
    luka.append(luka[i-1]+luka[i-2])

print(luka[N])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import functools

memo = {}
#@functools.lru_cache(maxsize=-1)
def L(i):
    if i==0:
        return 2
    if i==1:
        return 1
    if i in memo:
        return memo[i]
    memo[i] =  L(i-1)+L(i-2)
    return  memo[i]

for i in range(100):
    (L(i))

print(L(int(input())))

Submission status: Accepted

Solution code:
N=int(raw_input())
l1, l2 = 1, 2
for n in range(N-1):
  l1, l2 = l1+l2, l1
print l1

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
d = {0: 2, 1: 1}
def l(n):
    if n in d:
        return d[n]
    r = d[n] = l(n-1) + l(n-2)
    return r
print(l(int(input())))

Submission status: Accepted

Solution code:
lucas = {}

def luca(i):
    global lucas
    if i in lucas:
        return lucas[i]
    elif i == 0:
        ret = 2
    elif i == 1:
        ret = 1
    else:
        ret = luca(i-2) + luca(i-1)
    lucas[i] = ret
    return ret

N = int(input())

print(luca(N))

Submission status: Accepted

Solution code:
def solve(n):
    if cache[n] > 0:
        return cache[n]
    ret = cache[n] = solve(n - 1) + solve(n - 2)
    return ret


cache = [0] * 87
cache[0] = 2
cache[1] = 1
print(solve(int(input())))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# cook your dish here
# from math import * 
#for _ in range(int(input().strip())):

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

Submission status: Accepted

Solution code:
memo = {}


def L(n):
    if n in memo:
        return memo[n]
    if n == 0:
        return 2
    if n == 1:
        return 1
    memo[n] = L(n - 1) + L(n - 2)
    return memo[n]

print(L(int(input())))

Submission status: Accepted

Solution code:
from sys import stdin
a = [2,1]
for i in xrange(100):
 a.append(a[-1] + a[-2])
print a[int(stdin.readline())]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import functools


@functools.lru_cache(maxsize=None)
def lucas(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    else:
        return lucas(n - 1) + lucas(n - 2)


def main():
    n = int(input())
    print(lucas(n))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(raw_input())
l = [0]*100
l[0] = 2
l[1] = 1
for i in xrange(2,100):
    l[i] = l[i-1] + l[i-2]
print l[n]

Submission status: Accepted

Solution code:
l = [2, 1]
for x in xrange(2, 87):
    l.append(l[x - 2] + l[x - 1])
print l[input()]

Submission status: Accepted

Solution code:
# B
N = int(input())

l0 = 2
l1 = 1

for _ in range(N - 1):
    l0, l1 = l1, l0 + l1

print(l1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
x = []
for i in range(n+1):
    if i == 0:
        x.append(2)
    if i == 1:
        x.append(1)
    if i >= 2:
        x.append(x[-2] + x[-1])
print(x[-1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
s=[]
s[0]=2
s[1]=1
for i in range(2,86):
    s[i] = s[i-2]+s[i-1]
    if i==n-1:
        print(s[i])
        exit()

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;


int main() {
    int n;
    cin >> n;
    
    vector<ll> l(100);
    l[0] = 2;
    l[1] = 1;
    for (int i = 2; i <= n; i++)
    {
        l[i] = l[i-1] + l[i-2];
    }
    cout << l[n] << endl;
}

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#79B
N=int(input())
import ita
data=ita.array.make1d(N+1)
data[0]=2
data[1]=1
for i in range(2,N+1):
    data[i]=data[i-1]+data[i-2]
print(data[N])

Submission status: Runtime Error

Solution code:
N=int(input())
import ita
data=ita.array.make1d(N+1)
data[0]=2
data[1]=1
for i in range(2,N+1):
    data[i]=data[i-1]+data[i-2]
print(data[N])

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

print(L[n])

Submission status: Runtime Error

Solution code:
N = int(input())
L = [] * (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[N])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

L_2 = 2
L_1 = 1
for i in range(N-1):
    L = L_1+L_2
    L_2 = L_1
    L_1 = L
print(L)

Submission status: Runtime Error

Solution code:
N = int(input())
L = [0]*N
if N==1:
    print(2)
if N==2:
    print(1)
else:

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

for i in range(N+1):
    if i == 0:
        L_1 = 2
    elif i == 1:
        L_2 = 1
    else:
        L_3 = L_1 + L_2
        L_1 = L_2
        L_2 = L_3
        
print(L_3)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()

L = [2, 1]

if N == 1:
  print(1)
else:
  i = 1
  while i < N:
    L.append(L[i] + L[i-1])
    i += 1
  print(L[-1])

Submission status: Runtime Error

Solution code:
N=int(input())

def liu(i):
    if i==2:
        return 3
    if i==3:
        return 4
    else:
        return liu(i-1)+liu(i-2)

print(liu(N))

Submission status: Runtime Error

Solution code:
import collections
n,q = int(raw_input()) +1, collections.deque()
while(n):
	q.append(sum(list(q)) if len(q) < 2 else (len(q) +1))
	if len(q) == 3: q.popleft()
    n -=1
print q[-1]

Submission status: Runtime Error

Solution code:
N = int(input())
L = [0] * N
L[0] = 2
L[1] = 1

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

print(L[N-1])

Submission status: Runtime Error

Solution code:
N = int(input())
l = 2
l2 = 1

for i in range(N - 1):
    if i % 2 == 0:
        l = l + l2
    else:
        l2 = l + l2
    
if i % 2 == 1:
    print(l2)
else:
    print(l)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L = [0] * 87
L[0] = 2
L[1] = 1

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

print(L[N])

Submission status: Runtime Error

Solution code:
N=int(input())
L=[2,1]

for i in range(2,N):
  L.append(L[i-1]+L[i-2])
print(L[N+1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L0 = 2
L1 = 1

for n in range(N-1):
  L = L0+L1
  L0 = L1
  L1 = L
  
print(L)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
#j = L0
j = 2
#k = L1
k = 1

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

for i in range(1,n):
    l = j + k
    j = k
    k = l

print(l)

Submission status: Runtime Error

Solution code:
n = int(input())
#j = L0
j = 2
#k = L1
k = 1

for i in range(1,n):
    l = j + k
    j = k
    k = l

print(l)

Submission status: Runtime Error

Solution code:
import functools
@fuctools.lru_cache(maxsize=None)

def luca(n):
    if n==0:
        return 2
    elif n == 1:
        return 1
    else:
        return luca(n-1)+luca(n-2)

N = int(input())

print(luca(N))

Submission status: Runtime Error

Solution code:
import functools
@lru_cache(maxsize=None)

def luca(n):
    if n==0:
        return 2
    elif n == 1:
        return 1
    else:
        return luca(n-1)+luca(n-2)

N = int(input())

print(luca(N))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L0 = 2
L1 = 1
if N == 1:
    print(L1)

for i in range(1,N):
    res = L0 + L1
    L0 = L1
    L1 = res

print(res)

Submission status: Runtime Error

Solution code:
N = int(input())
L0 = 2
L1 = 1

for i in range(1,N):
    res = L0 + L1
    L0 = L1
    L1 = res

print(res)

Submission status: Runtime Error

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

print(ll[n])

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10000)

N = int(input())
l=[-1]*(n+1)

def lyuka(x):
  if l[x] != -1:
    return l[x]
  if x == 0:
    return 2
  if x == 1:
    return 1
  lyu = lyuka(x-1) + lyuka(x-2)
  l[x] = lyu
  return lyu

print(lyuka(N))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input)

def luca(N):
  if N>=2:
    return luca(N-2)+luca(N-1)
  if N==1:
    return 1
  if N==0:
    return 2
  
print(luca(N))

Submission status: Runtime Error

Solution code:
n=int(input())

a=2
b=1

if n==1:
  s=1
  n=2

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

if s==1:
  ans = 1

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())

a=2
b=1


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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
    n = input()

    array = [2,1]
    for i in range(100):
        array.append(array[i]+array[i+1])
    print(array[n])


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if n >= 3:
    for i in range(2,n+1):
        p.append(p[i-2]+p[i-1])

print(p[n])

Submission status: Runtime Error

Solution code:
N = int(input())

Li_2 = 2
Li_1 = 1

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

Submission status: Runtime Error

Solution code:
l = [2, 1]

def l(x):
  if len(l) > x:
    return l[x]
  else:
    return l(x-1) + l(x-2)
  
print(l(int(input())))

Submission status: Runtime Error

Solution code:
l = [2, 1]

def l(x):
  if len(l) > x:
    return l[x]
  else:
    return l(x-1) + l(x-2)
  
print(l(int(input()))

Submission status: Runtime Error

Solution code:
n = input()
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
n = int(input())
L = [0 for _ in range(86)]
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: Runtime Error

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: Runtime Error

Solution code:
from typing import List


N = int(input())

L: List[int] = [None] * (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[N])

Submission status: Runtime Error

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

print(L2)

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
L = np.zeros(86,np.int64)
L[0] = 2
L[1] = 1

def luca(n):
    if n == 0:
        return L[0]
    elif n == 1:
        return L[1]
    if L[n] != 0:
        return L[n]
    L[n] =luca(n-1) + luca(n-2)
    return L[n]
print(luca(N))

Submission status: Runtime Error

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())])

Submission status: Runtime Error

Solution code:
a = int(input())

def luc(n):
  if n = 0:
    return 2
  elif n = 1:
    return 1
  else:
    return luc(n-1) + luc(n-2)

print(luc(a))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m); (i) > (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define R cin>>
#define repr(i, n) REPR(i, n, 0)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define in(a) insert(a)
#define P(p) cout<<(p)<<endl;
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SORT(a) sort((a).begin(), (a).end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename T> void co(T e){cout << e << "\n";}
template<typename T> void co(const vector<T>& v){for(const auto& e : v)
    { cout << e << " "; } cout << "\n";}
ll gcd(ll a, ll b) {
    if (a < b)swap(a, b);
    if (b == 0) return a;
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}
ll lcm(ll a, ll b) {
    ll g = gcd(a, b);
    return a * b / g;
}
bool prime(ll n) {
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n%i == 0)return false;
    }
    return n != 1;
}

Vec fac, finv;

ll PowMod(ll a, ll n){
    if(n == 1) return a;
    if(n%2 == 0) return PowMod(a*a%MOD, n/2);
    return a*PowMod(a*a%MOD, n/2)%MOD;
}

ll combi(ll n, ll k){
    if(k>n) return 0;
    return fac[n]*finv[k]%MOD*finv[n-k]%MOD;
}

int main(){
    int n;
    cin >> n;
    ll l[2] = {2, 1};
    rep(i, n - 1){
        l[i % 2] = l[0] + l[1];
    }
    cout << l[n % 2] << '\n';
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
r1=2
r2=1

if n == 1:
    print(r2)
else :
    for i in range(n-1):
        r3 = r1+r2
        r1 = r2
        r2 = r3
print(r3)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
L = []
L.append(2)
L.append(1)

for i in range(2,84):
  L.append(L[i-2] + L[i-1])
  

print(L[n-1])

Submission status: Runtime Error

Solution code:
import sympy
print([sympy.lucas(i) for i in range(1, int(input())+1)][-1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
n0 = 2
n1 = 1

if n == 1:
    print(1)
else:
    for _ in range(1, n):
        n0, n1 = n1, n0+n1
    print(n2)

Submission status: Runtime Error

Solution code:
n = int(input())
n0 = 2
n1 = 1

for _ in range(1, n):
    n2 = n0+n1
    n0, n1 = n1, n2
print(n2)