結果

問題 No.269 見栄っ張りの募金活動
ユーザー takakintakakin
提出日時 2020-05-11 21:33:21
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 425 bytes
コンパイル時間 1,593 ms
コンパイル使用メモリ 86,664 KB
実行使用メモリ 85,964 KB
最終ジャッジ日時 2023-09-26 11:06:21
合計ジャッジ時間 8,436 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,604 KB
testcase_01 AC 89 ms
71,656 KB
testcase_02 AC 85 ms
71,540 KB
testcase_03 AC 125 ms
76,368 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,s,k=map(int,input().split())
mod=10**9+7
import copy
s-=n*(n-1)//2*k
if s<0:
  print(0)
else:
  DP=[[0]*(s+1) for _ in range(n+1)]
  for i in range(s+1):
    DP[1][i]=1
  for i in range(2,n+1):
    for j in range(s+1):
      ct=0
      while j-ct*i>=0:
        DP[i][j]+=DP[i-1][j-ct*i]
        if DP[i][j]>mod:
          DP[i][j]%=mod
        ct+=1
  print(DP[n][s])
0