結果

問題 No.269 見栄っ張りの募金活動
ユーザー rpy3cpprpy3cpp
提出日時 2015-08-22 13:21:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 504 ms / 5,000 ms
コード長 182 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 9,628 KB
最終ジャッジ日時 2023-09-23 01:10:28
合計ジャッジ時間 2,470 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,836 KB
testcase_01 AC 16 ms
7,956 KB
testcase_02 AC 15 ms
7,916 KB
testcase_03 AC 28 ms
7,868 KB
testcase_04 AC 178 ms
9,372 KB
testcase_05 AC 16 ms
8,000 KB
testcase_06 AC 15 ms
7,852 KB
testcase_07 AC 504 ms
9,628 KB
testcase_08 AC 15 ms
7,820 KB
testcase_09 AC 15 ms
7,856 KB
testcase_10 AC 15 ms
8,012 KB
testcase_11 AC 43 ms
9,020 KB
testcase_12 AC 15 ms
7,864 KB
testcase_13 AC 64 ms
8,616 KB
testcase_14 AC 16 ms
8,428 KB
testcase_15 AC 58 ms
8,760 KB
testcase_16 AC 15 ms
7,856 KB
testcase_17 AC 15 ms
7,964 KB
testcase_18 AC 173 ms
8,540 KB
testcase_19 AC 59 ms
8,352 KB
testcase_20 AC 21 ms
8,420 KB
testcase_21 AC 20 ms
8,800 KB
testcase_22 AC 44 ms
8,248 KB
testcase_23 AC 18 ms
7,968 KB
testcase_24 AC 26 ms
8,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,S,K=map(int,input().split())
S-=N*(N-1)*K//2
if S<0:print(0)
else:
  dp=[1]*(S+1)
  for n in range(2,N):
    for s in range(n,S+1): dp[s]+=dp[s-n]
  print(sum(dp[S::-N])%(10**9+7))
0