結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,880 KB
testcase_01 AC 33 ms
10,880 KB
testcase_02 AC 36 ms
11,136 KB
testcase_03 AC 138 ms
14,336 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 82 ms
18,688 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 72 ms
17,024 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 69 ms
16,896 KB
testcase_17 AC 41 ms
12,032 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 143 ms
16,128 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
if N*N*K/2 > S:
    print(0)
    sys.exit()
for i in range(0, N + 1):
    for l in range(1, S + 1):
        if (l - (N - i)) >= 0:
            dp[i][l] = (dp[i - 1][l - (N - i)] + dp[i][l - (N - i)]) % MOD
print(dp[N - 1][S])
0