葉林
Linked with GitHub
# ZeroJudge - d389: 11069 - A Graph Problem ### 題目連結:https://zerojudge.tw/ShowProblem?problemid=d389 ###### tags: `ZeroJudge` `動態規劃(Dynamic Programming)` ```cpp= #include <iostream> using namespace std; int DP[77] = { 1, 1, 2 }, nodes; void Initialize() { for (int i = 3; i <= 76; ++i) DP[i] = DP[i - 2] + DP[i - 3]; } int main() { cin.sync_with_stdio(false); cin.tie(nullptr); Initialize(); while (cin >> nodes) cout << DP[nodes] << '\n'; } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up