結果

問題 No.314 ケンケンパ
ユーザー fumofumofunifumofumofuni
提出日時 2021-09-12 23:35:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 212 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 47,072 KB
最終ジャッジ日時 2023-09-07 01:47:32
合計ジャッジ時間 9,694 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 387 ms
46,944 KB
testcase_01 AC 378 ms
46,976 KB
testcase_02 AC 381 ms
46,900 KB
testcase_03 AC 389 ms
47,072 KB
testcase_04 AC 381 ms
46,960 KB
testcase_05 WA -
testcase_06 AC 380 ms
46,972 KB
testcase_07 AC 383 ms
46,932 KB
testcase_08 AC 382 ms
47,040 KB
testcase_09 AC 381 ms
46,972 KB
testcase_10 AC 386 ms
47,056 KB
testcase_11 AC 388 ms
47,000 KB
testcase_12 AC 379 ms
46,944 KB
testcase_13 AC 389 ms
47,036 KB
testcase_14 AC 383 ms
47,036 KB
testcase_15 AC 384 ms
46,960 KB
testcase_16 AC 400 ms
46,936 KB
testcase_17 AC 380 ms
46,976 KB
testcase_18 AC 380 ms
47,060 KB
testcase_19 AC 391 ms
46,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=1000000007
maxN=1000010
dp=[0]*maxN
dp[2]=1
dp[3]=1
dp[4]=1
for i in range(5,maxN):
    dp[i]=(dp[i-2]+dp[i-3])%mod
N=int(input())
if N==1 or N==2 :
    print(1)
else :
    print((dp[N]+dp[N-1]+dp[N-2])%mod)
0