結果

問題 No.287 場合の数
ユーザー lam6er
提出日時 2025-03-20 20:21:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 296 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,496 KB
実行使用メモリ 53,988 KB
最終ジャッジ日時 2025-03-20 20:23:08
合計ジャッジ時間 1,906 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())
result = 0
max_k = (6 * n) // (n + 1)
for k in range(0, max_k + 1):
    s = 6 * n - k * (n + 1)
    if s < 0:
        continue
    comb_8k = math.comb(8, k)
    comb_s7 = math.comb(s + 7, 7)
    term = ((-1) ** k) * comb_8k * comb_s7
    result += term
print(result)
0