This commit is contained in:
2025-12-05 21:18:40 +08:00
parent 36c5339b1f
commit 727096b8e6
3 changed files with 67 additions and 0 deletions

14
src/509.c Normal file
View File

@@ -0,0 +1,14 @@
// This file is generated by mkfile.py
// Date: 2025-12-05
#include <solution/509.h>
int fib(int n)
{
int dp[n + 1];
dp[0] = 0;
if (n >= 1)
dp[1] = 1;
for (int i = 2; i <= n; i++)
dp[i] = dp[i - 1] + dp[i - 2];
return dp[n];
}