結果

問題 No.786 京都大学の過去問
ユーザー pianonekopianoneko
提出日時 2019-03-02 12:09:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 382 bytes
コンパイル時間 1,554 ms
コンパイル使用メモリ 165,776 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-05 16:50:58
合計ジャッジ時間 7,526 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define llINF ((long long)1e18)
#define INF ((int)1e9);
#define ALL(obj) obj.begin(), obj.end()

using namespace std;

int N;

int rec(int n) {
    if (n > N) return 0;
    if (n == N) return 1;
    int res = rec(n + 1) + rec(n + 2);
    return res;
}

int main() { 
    cin >> N;
    cout << rec(0) << endl;
}
0