結果

問題 No.786 京都大学の過去問
ユーザー tcltktcltk
提出日時 2021-01-16 06:11:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 247 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 1,610 ms
コンパイル使用メモリ 86,796 KB
実行使用メモリ 91,952 KB
最終ジャッジ日時 2023-08-18 02:44:09
合計ジャッジ時間 3,522 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 247 ms
91,716 KB
testcase_01 AC 245 ms
91,752 KB
testcase_02 AC 243 ms
91,952 KB
testcase_03 AC 244 ms
91,692 KB
testcase_04 AC 246 ms
91,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#region Header
#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
from queue import PriorityQueue
import bisect
import heapq

def input():
    return sys.stdin.readline()[:-1]

sys.setrecursionlimit(1000000)
#endregion

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)



def main():
    N = int(input())
    
    dp = [0 for _ in range(N+1)]
    dp[0] = 1
    dp[1] = 1
    for i in range(2, N+1):
        dp[i] = dp[i-2] + dp[i-1]
    print(dp[N])


if __name__ == '__main__':
    main()
0