結果

問題 No.44 DPなすごろく
ユーザー yassu0320yassu0320
提出日時 2021-07-11 16:20:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 161 ms / 5,000 ms
コード長 845 bytes
コンパイル時間 865 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 80,352 KB
最終ジャッジ日時 2023-09-14 20:12:49
合計ジャッジ時間 6,281 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
80,128 KB
testcase_01 AC 158 ms
80,120 KB
testcase_02 AC 159 ms
80,124 KB
testcase_03 AC 160 ms
80,096 KB
testcase_04 AC 159 ms
80,044 KB
testcase_05 AC 159 ms
80,168 KB
testcase_06 AC 160 ms
80,080 KB
testcase_07 AC 158 ms
80,156 KB
testcase_08 AC 160 ms
80,300 KB
testcase_09 AC 158 ms
80,096 KB
testcase_10 AC 158 ms
80,352 KB
testcase_11 AC 159 ms
80,256 KB
testcase_12 AC 157 ms
80,208 KB
testcase_13 AC 159 ms
80,124 KB
testcase_14 AC 159 ms
80,040 KB
testcase_15 AC 160 ms
80,168 KB
testcase_16 AC 161 ms
80,048 KB
testcase_17 AC 158 ms
80,112 KB
testcase_18 AC 157 ms
80,036 KB
testcase_19 AC 157 ms
80,064 KB
testcase_20 AC 158 ms
80,080 KB
testcase_21 AC 158 ms
80,244 KB
testcase_22 AC 158 ms
80,232 KB
testcase_23 AC 158 ms
80,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

from sys import setrecursionlimit, stdin
from typing import Dict, Iterable, Set

INF: int = 2**62
MOD: int = 10**9 + 7

setrecursionlimit(10**6)


def inputs(type_=int):
    ins = input().split(' ')
    ins = [x for x in ins if x != '']

    if isinstance(type_, Iterable):
        return [t(x) for t, x in zip(type_, ins)]
    else:
        return list(map(type_, ins))


def input_(type_=int):
    a, = inputs(type_)
    return a


inputi = input_


def inputstr():
    return input_(str)


# b/aの切り上げ
def ceil(b, a):
    return (a + b - 1) // a


def answer(res) -> None:
    print(res)
    exit()


def compute():
    return

def fib(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b

    return a

def main():
    n = inputi()
    print(fib(n + 1))


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