結果

問題 No.786 京都大学の過去問
ユーザー tko919tko919
提出日時 2019-04-22 20:55:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 706 bytes
コンパイル時間 641 ms
コンパイル使用メモリ 93,976 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 03:28:39
合計ジャッジ時間 1,024 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <math.h>
#include <complex>
#include <cassert>
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define case(i) cout<<"Case #"<<i<<": "
using namespace std;
typedef long long int ll;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const ll INF = 4e18;



int main() {
	int n; cin >> n;
	vector<ll> a(n + 1,0);
	a[0] = 1, a[1] = 1;
	rep(i, 0, n-1) {
		a[i + 2] = a[i] + a[i + 1];
	}
	cout << a[n] << endl;
	return 0;
}
0