結果
問題 |
No.44 DPなすごろく
|
ユーザー |
![]() |
提出日時 | 2018-06-05 21:32:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 610 ms |
コンパイル使用メモリ | 69,364 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 10:05:53 |
合計ジャッジ時間 | 1,480 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; typedef long long ll; ll n; ll dp[55][55]; int main(void){ cin>>n; dp[0][0]=1; for(int i=0;i<n;i++){ for(int j=0;j<=n;j++){ dp[i+1][j+2]+=dp[i][j]; dp[i+1][j+1]+=dp[i][j]; } } ll ans=0; for(int i=0;i<=n;i++)ans+=dp[i][n]; cout<<ans<<endl; }