結果

問題 No.269 見栄っ張りの募金活動
ユーザー yamamura-kyamamura-k
提出日時 2020-03-11 15:02:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 59,136 KB
最終ジャッジ日時 2024-04-27 19:15:55
合計ジャッジ時間 3,503 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 23 ms
10,752 KB
testcase_02 AC 28 ms
10,880 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 RE -
testcase_07 WA -
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 228 ms
21,760 KB
testcase_10 AC 28 ms
10,752 KB
testcase_11 WA -
testcase_12 AC 200 ms
17,280 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 180 ms
18,688 KB
testcase_17 AC 52 ms
11,776 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 38 ms
12,160 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9+7
def main():
    N,S,K = map(int,input().split())
    dp = [[0 for _ in range(S+1)] for _ in range(N)]
    dp[0][0] = 1
    for i in range(N):
        for j in range(S+1):
            if j >= K*(N-i):
                dp[i][j] = dp[i][j-(N-i)]+dp[i-1][j-K*(N-i)]
            elif j >= N-i:
                dp[i][j] = dp[i][j-N+i]
    print(dp[-1][-1])
if __name__ == '__main__':
    main()
0