結果
問題 |
No.44 DPなすごろく
|
ユーザー |
![]() |
提出日時 | 2017-10-17 12:46:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 418 bytes |
コンパイル時間 | 596 ms |
コンパイル使用メモリ | 81,104 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 21:46:15 |
合計ジャッジ時間 | 1,293 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <iostream> #include <queue> #include <vector> #include <cmath> #include <algorithm> #include <map> #include <numeric> using namespace std; using ll = long long; const ll INF = 1e9; const ll MOD = 1e9 + 7; ll dp[52]; int main() { int N; cin >> N; dp[0] = 1; for (int i = 0; i < N; i++) { dp[i+1] += dp[i]; dp[i+2] += dp[i]; } cout << dp[N] << endl; return 0; }