We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 454f276 commit fc7ab80Copy full SHA for fc7ab80
🪙 S3/17175.py
@@ -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