結果

問題 No.269 見栄っ張りの募金活動
ユーザー ryuhei1230ryuhei1230
提出日時 2019-08-11 15:39:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 2,363 ms
コンパイル使用メモリ 86,824 KB
実行使用メモリ 75,760 KB
最終ジャッジ日時 2023-10-11 21:14:46
合計ジャッジ時間 3,748 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,300 KB
testcase_01 AC 74 ms
71,204 KB
testcase_02 AC 71 ms
71,160 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 74 ms
71,008 KB
testcase_07 WA -
testcase_08 AC 75 ms
71,068 KB
testcase_09 AC 73 ms
71,088 KB
testcase_10 AC 72 ms
71,240 KB
testcase_11 WA -
testcase_12 AC 72 ms
71,072 KB
testcase_13 WA -
testcase_14 AC 75 ms
75,548 KB
testcase_15 WA -
testcase_16 AC 71 ms
71,076 KB
testcase_17 AC 72 ms
71,144 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 75 ms
75,404 KB
testcase_21 AC 77 ms
75,288 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 78 ms
75,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, s, k = map(int, input().split())
mod = 10 **9 +7


def div_num(n, k):
    dp = (n+1) * [1]
    for i in range(2, k+1):
        for j in range(i, n+1):
            dp[j] = dp[j] + dp[j - i] % mod
    return dp[-1]


if s - n *((n-1) * k) //2 < 0:
     print(0)
else:
    print(div_num(s - n *(n-1) * k // 2, n))
0