結果

問題 No.269 見栄っ張りの募金活動
ユーザー mlihua09mlihua09
提出日時 2020-09-01 19:57:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 82,128 KB
実行使用メモリ 86,136 KB
最終ジャッジ日時 2024-04-30 17:14:26
合計ジャッジ時間 2,762 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,352 KB
testcase_01 AC 40 ms
53,100 KB
testcase_02 AC 41 ms
52,532 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 38 ms
53,880 KB
testcase_07 WA -
testcase_08 AC 37 ms
52,524 KB
testcase_09 AC 38 ms
52,068 KB
testcase_10 AC 38 ms
52,196 KB
testcase_11 WA -
testcase_12 AC 38 ms
52,592 KB
testcase_13 WA -
testcase_14 AC 42 ms
59,532 KB
testcase_15 WA -
testcase_16 AC 39 ms
52,748 KB
testcase_17 AC 40 ms
52,456 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 46 ms
58,756 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

P = 10 ** 9 + 7

N, S, K = map(int, input().split())

S -= K * N * (N - 1) // 2

if S < 0:
    print(0)
    
else:
    dp = [0] * (S + 1)
    
    dp[0] = 1
    
    for i in range(N, 1, -1):
        for j in range(i, S + 1):
            dp[j] += dp[j - i]
            
    print(sum(dp))
0