結果
| 問題 |
No.44 DPなすごろく
|
| ユーザー |
J31831276
|
| 提出日時 | 2018-12-28 03:24:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 275 bytes |
| コンパイル時間 | 407 ms |
| コンパイル使用メモリ | 57,748 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-01 14:57:46 |
| 合計ジャッジ時間 | 1,172 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#define ll long long
using namespace std;
int main(){
int n;
cin>>n;
ll dp[51];
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;
}
J31831276