結果

問題 No.269 見栄っ張りの募金活動
ユーザー ky_used_beforeky_used_before
提出日時 2020-02-21 15:41:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 30,080 KB
最終ジャッジ日時 2024-04-17 06:44:53
合計ジャッジ時間 8,353 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
11,008 KB
testcase_01 AC 30 ms
11,136 KB
testcase_02 AC 45 ms
11,264 KB
testcase_03 AC 145 ms
14,464 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 725 ms
19,584 KB
testcase_10 AC 35 ms
11,008 KB
testcase_11 WA -
testcase_12 AC 574 ms
17,408 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 506 ms
17,024 KB
testcase_17 AC 126 ms
12,288 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 157 ms
16,256 KB
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
from collections import deque
import copy
import bisect

MOD = 10 ** 9 + 7
N, S, K = map(int, input().split())
dp = [[0 for _ in range(S + 10)] for _ in range(N + 10)]
dp[0][0] = 1
for i in range(0, N):
    for l in range(1, S+1):
        if (l - K*(N - i)) >= 0:
            dp[i][l] = (dp[i - 1][l - K*(N - i)] + dp[i][l - K*(N - i)]) % MOD
print(dp[N - 1][S])
0