結果

問題 No.287 場合の数
ユーザー H3PO4H3PO4
提出日時 2023-06-17 20:28:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 177 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 29,772 KB
最終ジャッジ日時 2023-09-07 16:25:46
合計ジャッジ時間 4,939 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
29,764 KB
testcase_01 AC 133 ms
29,712 KB
testcase_02 AC 131 ms
29,744 KB
testcase_03 AC 130 ms
29,744 KB
testcase_04 AC 129 ms
29,772 KB
testcase_05 AC 129 ms
29,668 KB
testcase_06 AC 128 ms
29,692 KB
testcase_07 AC 129 ms
29,712 KB
testcase_08 AC 131 ms
29,724 KB
testcase_09 AC 133 ms
29,728 KB
testcase_10 AC 131 ms
29,724 KB
testcase_11 AC 130 ms
29,728 KB
testcase_12 AC 129 ms
29,660 KB
testcase_13 AC 132 ms
29,692 KB
testcase_14 AC 129 ms
29,576 KB
testcase_15 AC 129 ms
29,712 KB
testcase_16 AC 131 ms
29,712 KB
testcase_17 AC 130 ms
29,728 KB
testcase_18 AC 130 ms
29,688 KB
testcase_19 AC 133 ms
29,684 KB
testcase_20 AC 133 ms
29,736 KB
testcase_21 AC 132 ms
29,668 KB
testcase_22 AC 133 ms
29,748 KB
testcase_23 AC 130 ms
29,708 KB
testcase_24 AC 131 ms
29,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N = int(input())
dp = np.zeros(6 * N + 1, dtype=np.int64)
dp[0] = 1
for i in range(8):
    np.cumsum(dp, out=dp)
    dp[N + 1:] -= dp[:-N - 1]
print(dp[-1])
0