結果

問題 No.269 見栄っ張りの募金活動
ユーザー pluto77pluto77
提出日時 2018-02-11 11:38:33
言語 Python2
(2.7.18)
結果
AC  
実行時間 371 ms / 5,000 ms
コード長 223 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 6,568 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2023-09-23 01:26:26
合計ジャッジ時間 2,779 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,892 KB
testcase_01 AC 11 ms
5,940 KB
testcase_02 AC 11 ms
5,996 KB
testcase_03 AC 22 ms
5,964 KB
testcase_04 AC 132 ms
7,532 KB
testcase_05 AC 12 ms
5,852 KB
testcase_06 AC 11 ms
5,988 KB
testcase_07 AC 371 ms
7,976 KB
testcase_08 AC 11 ms
5,944 KB
testcase_09 AC 12 ms
5,948 KB
testcase_10 AC 12 ms
6,084 KB
testcase_11 AC 32 ms
6,816 KB
testcase_12 AC 11 ms
5,996 KB
testcase_13 AC 49 ms
6,540 KB
testcase_14 AC 13 ms
6,060 KB
testcase_15 AC 43 ms
6,500 KB
testcase_16 AC 11 ms
5,956 KB
testcase_17 AC 11 ms
5,844 KB
testcase_18 AC 131 ms
6,440 KB
testcase_19 AC 44 ms
6,304 KB
testcase_20 AC 15 ms
6,084 KB
testcase_21 AC 16 ms
6,484 KB
testcase_22 AC 32 ms
6,176 KB
testcase_23 AC 13 ms
5,996 KB
testcase_24 AC 19 ms
6,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki269
import sys

n,s,k=map(int,raw_input().split())
s-=k*n*(n-1)/2
if s<0:
 print 0
 sys.exit()
dp=[1 for i in xrange(s+1)]
for i in xrange(2,n):
 for j in xrange(i,s+1):
  dp[j]+=dp[j-i]
print sum(dp[s::-n])%(10**9+7)
0