結果

問題 No.269 見栄っ張りの募金活動
ユーザー ああいいああいい
提出日時 2022-03-02 13:50:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 509 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 95,844 KB
最終ジャッジ日時 2023-09-23 07:06:33
合計ジャッジ時間 14,063 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
75,816 KB
testcase_01 AC 75 ms
71,184 KB
testcase_02 AC 77 ms
71,088 KB
testcase_03 AC 110 ms
76,192 KB
testcase_04 TLE -
testcase_05 AC 84 ms
76,028 KB
testcase_06 AC 77 ms
71,540 KB
testcase_07 TLE -
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 #

N,S,K = map(int,input().split())
D = K * (N-1) * N // 2
import sys
if S < D:
    print(0)
    exit()
S -= D
dp = [[0] * (S +1) for _ in range(N)]
i = 0
P = 10 ** 9 + 7
while i * N <= S:
    dp[0][i * N] += 1
    i += 1
for i in range(1,N-1):
    for j in range(S+1):
        k = j
        while k <= S:
            dp[i][k] += dp[i-1][j]
            dp[i][k] %= P
            k += N - i
    for j in range(S + 1):
        dp[i][j] %= P
ans = 0
for j in range(S+1):
    ans = (ans + dp[N-2][j]) % P
print(ans)
0