結果

問題 No.314 ケンケンパ
ユーザー TsubasaTsubasa
提出日時 2018-02-02 20:46:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 185 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 16,276 KB
最終ジャッジ日時 2023-08-30 01:54:17
合計ジャッジ時間 2,810 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 292 ms
16,276 KB
testcase_01 AC 20 ms
8,636 KB
testcase_02 AC 20 ms
8,688 KB
testcase_03 AC 19 ms
8,636 KB
testcase_04 WA -
testcase_05 AC 19 ms
8,616 KB
testcase_06 AC 20 ms
8,584 KB
testcase_07 AC 19 ms
8,568 KB
testcase_08 AC 19 ms
8,672 KB
testcase_09 AC 19 ms
8,500 KB
testcase_10 AC 19 ms
8,592 KB
testcase_11 AC 19 ms
8,636 KB
testcase_12 AC 19 ms
8,508 KB
testcase_13 AC 20 ms
8,536 KB
testcase_14 AC 21 ms
8,636 KB
testcase_15 AC 22 ms
8,700 KB
testcase_16 AC 27 ms
8,760 KB
testcase_17 AC 47 ms
9,252 KB
testcase_18 AC 153 ms
12,168 KB
testcase_19 AC 295 ms
16,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import array

def main():
  dp = array.array("Q", [1,2,2])
  mod = 10**9 + 7
  N = int(input())

  for n in range(3, N):
    dp.append((dp[n-3]+dp[n-2]) % mod)

  print(dp[-1])

main()
0