結果

問題 No.269 見栄っ張りの募金活動
ユーザー 藤原正貴藤原正貴
提出日時 2020-04-22 19:06:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 352 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 82,396 KB
実行使用メモリ 277,500 KB
最終ジャッジ日時 2024-04-20 04:17:51
合計ジャッジ時間 2,537 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
52,948 KB
testcase_01 AC 38 ms
53,312 KB
testcase_02 AC 36 ms
53,180 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 33 ms
53,104 KB
testcase_07 WA -
testcase_08 AC 36 ms
52,068 KB
testcase_09 AC 34 ms
52,672 KB
testcase_10 AC 34 ms
52,616 KB
testcase_11 WA -
testcase_12 AC 32 ms
53,500 KB
testcase_13 WA -
testcase_14 AC 40 ms
59,224 KB
testcase_15 WA -
testcase_16 AC 31 ms
52,904 KB
testcase_17 AC 32 ms
53,580 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 41 ms
60,568 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,S,K = map(int,input().split())
S -= int(N*(N-1)/2*K)
dp = [[0]*(S+1) for _ in range(N+1)]
if S<0:
    print(0)
    exit()
if S == 0:
    print(1)
    exit()
dp[0][0] = 1
for i in range(1,N+1):
    for j in range(S+1):
        if j-i>=0:
            dp[i][j] = dp[i-1][j] + dp[i][j-i]
        else:
            dp[i][j] = dp[i-1][j]

print(dp[-1][-1])
0