結果

問題 No.786 京都大学の過去問
ユーザー suakiisuakii
提出日時 2019-04-19 08:22:46
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 2,955 ms
コンパイル使用メモリ 159,380 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-23 17:23:03
合計ジャッジ時間 3,655 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;


int main() {
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int a[100];
    a[1] = 1;
    a[2] = 2;

    for (int i = 3; i <= n; i++)
        a[i] = a[i-1] + a[i-2];
    
    cout << a[n] << endl;








    return 0;
}

0