結果

問題 No.269 見栄っ張りの募金活動
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-09-27 17:26:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 678 ms / 5,000 ms
コード長 171 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 8,948 KB
最終ジャッジ日時 2023-09-13 02:06:48
合計ジャッジ時間 3,003 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,148 KB
testcase_01 AC 15 ms
7,804 KB
testcase_02 AC 15 ms
8,072 KB
testcase_03 AC 36 ms
7,868 KB
testcase_04 AC 245 ms
8,816 KB
testcase_05 AC 16 ms
7,916 KB
testcase_06 AC 15 ms
7,816 KB
testcase_07 AC 678 ms
8,816 KB
testcase_08 AC 15 ms
7,856 KB
testcase_09 AC 15 ms
8,056 KB
testcase_10 AC 15 ms
7,908 KB
testcase_11 AC 62 ms
8,796 KB
testcase_12 AC 16 ms
8,204 KB
testcase_13 AC 86 ms
8,288 KB
testcase_14 AC 23 ms
8,948 KB
testcase_15 AC 78 ms
8,608 KB
testcase_16 AC 15 ms
8,264 KB
testcase_17 AC 15 ms
8,056 KB
testcase_18 AC 229 ms
8,216 KB
testcase_19 AC 78 ms
8,288 KB
testcase_20 AC 26 ms
8,412 KB
testcase_21 AC 26 ms
8,716 KB
testcase_22 AC 54 ms
8,364 KB
testcase_23 AC 20 ms
7,844 KB
testcase_24 AC 33 ms
8,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=10**9+7
n,s,k=map(int,input().split())
s-=n*(n-1)//2*k-1
if s<1:exit(print(0))
dp=[1]*s
for i in range(2,n+1):
 for j in range(i,s):dp[j]=(dp[j]+dp[j-i])%M
print(dp[-1])
0