結果

問題 No.287 場合の数
ユーザー takakintakakin
提出日時 2020-06-21 20:48:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 191 ms / 5,000 ms
コード長 251 bytes
コンパイル時間 732 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 8,320 KB
最終ジャッジ日時 2023-09-16 18:51:28
合計ジャッジ時間 4,300 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
7,784 KB
testcase_01 AC 15 ms
7,788 KB
testcase_02 AC 17 ms
7,776 KB
testcase_03 AC 178 ms
7,856 KB
testcase_04 AC 191 ms
8,320 KB
testcase_05 AC 137 ms
7,804 KB
testcase_06 AC 24 ms
7,848 KB
testcase_07 AC 66 ms
7,756 KB
testcase_08 AC 97 ms
7,900 KB
testcase_09 AC 134 ms
7,804 KB
testcase_10 AC 188 ms
8,192 KB
testcase_11 AC 54 ms
7,952 KB
testcase_12 AC 163 ms
7,896 KB
testcase_13 AC 33 ms
7,848 KB
testcase_14 AC 78 ms
7,796 KB
testcase_15 AC 134 ms
7,756 KB
testcase_16 AC 79 ms
7,804 KB
testcase_17 AC 160 ms
7,784 KB
testcase_18 AC 65 ms
7,828 KB
testcase_19 AC 146 ms
7,776 KB
testcase_20 AC 90 ms
7,820 KB
testcase_21 AC 139 ms
7,780 KB
testcase_22 AC 129 ms
7,848 KB
testcase_23 AC 111 ms
7,896 KB
testcase_24 AC 75 ms
7,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
DP=[[0]*(6*n+1) for _ in range(9)]
DP[0][0]=1
for i in range(8):
  for j in range(6*n+1):
    for k in range(n+1):
      if j+k<=6*n:
        DP[i+1][j+k]+=DP[i][j]
print(DP[8][-1])
0