From 6bc0727b8b7b890aab9c7c5503b82bdfecf4abd9 Mon Sep 17 00:00:00 2001 From: xingyou wu <3050128610@qq.com> Date: Tue, 8 Apr 2025 17:24:19 +0800 Subject: [PATCH] add test4 file --- others/test4.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 others/test4.cpp diff --git a/others/test4.cpp b/others/test4.cpp new file mode 100644 index 0000000..5e10680 --- /dev/null +++ b/others/test4.cpp @@ -0,0 +1,14 @@ +#include +using namespace std; +#define int long long +const int N = 1e5+7; +int dp[N]; +signed main(){ + dp[1] = dp[2] = 1; + int n; cin >> n; + for(int i = 3; i <= n; i++){ + dp[i] = dp[i-1] + dp[i-2]; + } + cout << dp[n] << endl; + return 0; +} \ No newline at end of file