結果

問題 No.269 見栄っ張りの募金活動
ユーザー takin6takin6
提出日時 2020-05-18 14:10:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 253 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 147,712 KB
最終ジャッジ日時 2024-04-09 21:28:04
合計ジャッジ時間 3,636 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n,s,k = map(int, input().split())
s -= (n*(n-1)//2)*k
dp = [ [1]*(s+1) for _ in range(n+1) ]

for i in range(2, n+1):
  for j in range(s+1):
    if j >= i:
      dp[i][j] = dp[i-1][j] + dp[i][j-i]
    else:
      dp[i][j] = dp[i-1][j]

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