結果
| 問題 | No.44 DPなすごろく |
| ユーザー |
|
| 提出日時 | 2022-10-04 19:30:17 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 378µs | |
| コード長 | 485 bytes |
| 記録 | |
| コンパイル時間 | 862 ms |
| コンパイル使用メモリ | 179,336 KB |
| 実行使用メモリ | 9,916 KB |
| 最終ジャッジ日時 | 2026-10-11 08:27:42 |
| 合計ジャッジ時間 | 2,183 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb emplace_back
#define sz(v) (int)(v.size())
#define all(v) (v.begin(),v.end())
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
int n;
cin >> n;
int dp[n+1];
dp[0] = 0;
dp[1] = 1;
dp[2] = 2;
for(int i = 3;i<n+1;i++){
dp[i] = dp[i-1] + dp[i-2];
}
cout << dp[n];
return 0;
}