結果

問題 No.269 見栄っ張りの募金活動
ユーザー ああいいああいい
提出日時 2022-03-02 13:46:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 441 bytes
コンパイル時間 520 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 81,880 KB
最終ジャッジ日時 2023-09-23 07:02:17
合計ジャッジ時間 8,240 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
75,696 KB
testcase_01 AC 81 ms
71,352 KB
testcase_02 AC 76 ms
71,460 KB
testcase_03 AC 107 ms
76,340 KB
testcase_04 TLE -
testcase_05 AC 83 ms
76,404 KB
testcase_06 AC 80 ms
71,340 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):
    for j in range(S+1):
        k = 0
        while j + k * (N-i) <= S:
            dp[i][j+k*(N-i)] += dp[i-1][j]
            k += 1
    for j in range(S + 1):
        dp[i][j] %= P
print(dp[-1][S])
0