結果

問題 No.269 見栄っ張りの募金活動
ユーザー NoneNone
提出日時 2021-05-04 22:42:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 5,000 ms
コード長 221 bytes
コンパイル時間 816 ms
コンパイル使用メモリ 86,172 KB
実行使用メモリ 75,880 KB
最終ジャッジ日時 2023-10-01 00:22:09
合計ジャッジ時間 3,966 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,904 KB
testcase_01 AC 74 ms
70,948 KB
testcase_02 AC 73 ms
70,892 KB
testcase_03 AC 78 ms
75,804 KB
testcase_04 AC 80 ms
75,592 KB
testcase_05 AC 77 ms
75,584 KB
testcase_06 AC 73 ms
70,840 KB
testcase_07 AC 87 ms
75,880 KB
testcase_08 AC 72 ms
70,452 KB
testcase_09 AC 72 ms
71,096 KB
testcase_10 AC 72 ms
71,136 KB
testcase_11 AC 79 ms
75,644 KB
testcase_12 AC 73 ms
70,884 KB
testcase_13 AC 77 ms
75,716 KB
testcase_14 AC 78 ms
75,608 KB
testcase_15 AC 79 ms
75,412 KB
testcase_16 AC 72 ms
70,880 KB
testcase_17 AC 73 ms
70,900 KB
testcase_18 AC 83 ms
75,492 KB
testcase_19 AC 79 ms
75,492 KB
testcase_20 AC 79 ms
75,548 KB
testcase_21 AC 79 ms
75,656 KB
testcase_22 AC 79 ms
75,804 KB
testcase_23 AC 77 ms
75,520 KB
testcase_24 AC 77 ms
75,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD=10**9+7
N,S,K=map(int, input().split())
S-=N*(N-1)//2*K
if S<0:
    print(0)
    exit()

dp=[0]*(S+1)
dp[0]=1
for i in range(1,N+1):
    for j in range(S+1-i):
        dp[j+i]+=dp[j]
        dp[j+i]%=MOD
print(dp[-1])
0