⌨️
[AtCoder]ABC-079|B - Lucas Number
設問ページ
提出結果
def getInt():
return int(input())
def main():
n = getInt()
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[n])
if __name__ == "__main__":
main()
Discussion