結果

問題 No.44 DPなすごろく
ユーザー tcltktcltk
提出日時 2021-01-17 04:37:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 620 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 82,092 KB
実行使用メモリ 89,376 KB
最終ジャッジ日時 2024-05-06 17:47:19
合計ジャッジ時間 4,315 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
89,192 KB
testcase_01 AC 123 ms
89,212 KB
testcase_02 AC 120 ms
89,284 KB
testcase_03 AC 124 ms
89,260 KB
testcase_04 AC 124 ms
89,148 KB
testcase_05 AC 126 ms
89,376 KB
testcase_06 AC 121 ms
89,064 KB
testcase_07 AC 119 ms
89,072 KB
testcase_08 AC 118 ms
89,092 KB
testcase_09 AC 118 ms
89,188 KB
testcase_10 AC 119 ms
89,044 KB
testcase_11 AC 119 ms
89,244 KB
testcase_12 AC 124 ms
89,236 KB
testcase_13 AC 122 ms
89,256 KB
testcase_14 AC 121 ms
89,220 KB
testcase_15 AC 121 ms
88,836 KB
testcase_16 AC 120 ms
88,840 KB
testcase_17 AC 121 ms
89,260 KB
testcase_18 AC 119 ms
88,820 KB
testcase_19 AC 118 ms
88,836 KB
testcase_20 AC 125 ms
89,072 KB
testcase_21 AC 123 ms
89,216 KB
testcase_22 AC 126 ms
89,364 KB
testcase_23 AC 119 ms
89,296 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