Skip to content

Commit fc7ab80

Browse files
committed
🪙 S3-17175
1 parent 454f276 commit fc7ab80

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

🪙 S3/17175.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
n = int(input())
2+
dp = [0]*51
3+
dp[0], dp[1] = 1, 1
4+
for i in range(2, n+1):
5+
dp[i] = (dp[i-2] + dp[i-1] + 1) % 1000000007
6+
print(dp[n])

0 commit comments

Comments
 (0)