結果
問題 |
No.44 DPなすごろく
|
ユーザー |
![]() |
提出日時 | 2015-09-15 01:53:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 326 bytes |
コンパイル時間 | 422 ms |
コンパイル使用メモリ | 60,764 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 06:33:06 |
合計ジャッジ時間 | 1,214 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; #define rep(i,m) for(int i=0;i<n;i++) typedef long long ll; int main(){ int N;cin>>N; vector<ll> dp(N+2,0); dp[0]=1; dp[1]=1; for(int i=2;i<=N;i++) dp[i] = dp[i-1]+dp[i-2]; cout << dp[N] << endl; return 0; }