結果

問題 No.314 ケンケンパ
ユーザー DexctersuDexctersu
提出日時 2017-12-24 00:00:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 163 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 47,244 KB
最終ジャッジ日時 2023-08-22 16:40:38
合計ジャッジ時間 2,559 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 371 ms
46,708 KB
testcase_01 AC 15 ms
7,956 KB
testcase_02 AC 15 ms
7,880 KB
testcase_03 AC 16 ms
7,928 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 15 ms
7,836 KB
testcase_07 AC 14 ms
7,872 KB
testcase_08 AC 14 ms
7,872 KB
testcase_09 AC 15 ms
7,868 KB
testcase_10 AC 15 ms
7,728 KB
testcase_11 AC 14 ms
7,784 KB
testcase_12 AC 15 ms
7,924 KB
testcase_13 AC 15 ms
7,900 KB
testcase_14 AC 17 ms
8,312 KB
testcase_15 AC 18 ms
8,252 KB
testcase_16 AC 24 ms
9,004 KB
testcase_17 AC 52 ms
11,892 KB
testcase_18 AC 193 ms
26,656 KB
testcase_19 AC 385 ms
47,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
v=[0]*n
v[0]=1
v[1]=2
v[2]=2
mod=10**9+7
if n<4:
    print(v[n-1])
else:
    for i in range(3,n):
        v[i]=(v[i-2]+v[i-3])%mod
    print(v[-1])
0