結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
89,204 KB
testcase_01 AC 151 ms
89,284 KB
testcase_02 AC 154 ms
89,248 KB
testcase_03 AC 144 ms
89,292 KB
testcase_04 AC 155 ms
89,064 KB
testcase_05 AC 154 ms
89,276 KB
testcase_06 AC 149 ms
89,068 KB
testcase_07 AC 148 ms
88,916 KB
testcase_08 AC 149 ms
89,212 KB
testcase_09 AC 148 ms
89,032 KB
testcase_10 AC 152 ms
89,216 KB
testcase_11 AC 153 ms
88,836 KB
testcase_12 AC 152 ms
89,228 KB
testcase_13 AC 150 ms
89,240 KB
testcase_14 AC 153 ms
89,204 KB
testcase_15 AC 147 ms
88,972 KB
testcase_16 AC 153 ms
88,848 KB
testcase_17 AC 153 ms
89,176 KB
testcase_18 AC 154 ms
89,264 KB
testcase_19 AC 147 ms
88,912 KB
testcase_20 AC 148 ms
89,380 KB
testcase_21 AC 149 ms
89,296 KB
testcase_22 AC 153 ms
89,192 KB
testcase_23 AC 154 ms
89,264 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