思路:经典递推板子题,中间再加个取mod操作即可
代码:
import sys
input = lambda: sys.stdin.readline().strip()
import math
inf = 10 ** 18
def I():
return input()
def II():
return int(input())
def MII():
return map(int, input().split())
def LI():
return input().split()
def LII():
return list(map(int, input().split()))
def LFI():
return list(map(float, input().split()))
fmax = lambda x, y: x if x > y else y
fmin = lambda x, y: x if x < y else y
isqrt = lambda x: int(math.sqrt(x))
'''
'''
def solve():
mod = 10 ** 9 + 7
k = II()
f1 = f2 = 1
for _ in range(3, k + 1):
f1, f2 = f2 % mod, (f1 + f2) % mod
print(f2)
t = 1
# t = II()
for _ in range(t):
solve()

京公网安备 11010502036488号