結果

問題 No.44 DPなすごろく
ユーザー vjudge1
提出日時 2024-02-19 22:32:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 285 bytes
コンパイル時間 1,935 ms
コンパイル使用メモリ 158,704 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-09-29 02:23:43
合計ジャッジ時間 2,611 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);
	int n; cin >> n; int f[n+1]; f[0] = f[1] = 1;
	for (int i = 2; i <= n; ++i) f[i] = f[i-1]+f[i-2];
	cout << f[n];
	return 0;
}
0