結果
| 問題 |
No.44 DPなすごろく
|
| ユーザー |
vjudge1
|
| 提出日時 | 2023-08-26 21:29:48 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 307 bytes |
| コンパイル時間 | 5,589 ms |
| コンパイル使用メモリ | 163,372 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 00:21:43 |
| 合計ジャッジ時間 | 6,547 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
const int N=59;
int n;
unsigned long long dp[N];
int main(){
#ifdef memset0
freopen("1.in","r",stdin);
#endif
ios::sync_with_stdio(0),cin.tie(0);
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;
}
vjudge1