結果

問題 No.314 ケンケンパ
ユーザー nohakai3nohakai3
提出日時 2022-10-17 20:21:04
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 181 bytes
コンパイル時間 1,505 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 82,756 KB
最終ジャッジ日時 2023-09-10 18:51:20
合計ジャッジ時間 3,940 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
82,648 KB
testcase_01 RE -
testcase_02 AC 74 ms
70,468 KB
testcase_03 AC 74 ms
70,956 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 73 ms
70,468 KB
testcase_07 AC 72 ms
70,908 KB
testcase_08 AC 71 ms
70,472 KB
testcase_09 AC 72 ms
70,596 KB
testcase_10 AC 73 ms
70,860 KB
testcase_11 AC 72 ms
70,728 KB
testcase_12 AC 73 ms
71,004 KB
testcase_13 AC 73 ms
70,896 KB
testcase_14 AC 76 ms
75,396 KB
testcase_15 AC 77 ms
75,400 KB
testcase_16 AC 79 ms
75,592 KB
testcase_17 AC 78 ms
75,884 KB
testcase_18 AC 81 ms
78,684 KB
testcase_19 AC 87 ms
82,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
dp=[0]*(n+1)
dp[1]=1
dp[2]=2
dp[3]=2
dp[4]=3
if n<=4:
    print(dp[n])
    exit()

for i in range(5,n+1):
    dp[i]=(dp[i-2]+dp[i-3])%(10**9+7)
print(dp[n]%(10**9+7))
0