結果

問題 No.269 見栄っ張りの募金活動
ユーザー urutomurutom
提出日時 2017-04-18 19:44:14
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 216 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 11,576 KB
実行使用メモリ 46,756 KB
最終ジャッジ日時 2023-09-26 13:25:13
合計ジャッジ時間 3,897 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,116 KB
testcase_01 AC 81 ms
15,296 KB
testcase_02 AC 80 ms
15,132 KB
testcase_03 AC 87 ms
16,632 KB
testcase_04 AC 171 ms
26,228 KB
testcase_05 AC 79 ms
15,544 KB
testcase_06 RE -
testcase_07 AC 335 ms
46,756 KB
testcase_08 AC 81 ms
15,292 KB
testcase_09 AC 79 ms
15,028 KB
testcase_10 RE -
testcase_11 AC 96 ms
17,468 KB
testcase_12 AC 78 ms
15,108 KB
testcase_13 AC 107 ms
18,820 KB
testcase_14 AC 84 ms
15,660 KB
testcase_15 AC 104 ms
18,736 KB
testcase_16 AC 78 ms
15,244 KB
testcase_17 AC 77 ms
15,316 KB
testcase_18 AC 165 ms
25,980 KB
testcase_19 AC 103 ms
18,572 KB
testcase_20 AC 88 ms
15,940 KB
testcase_21 AC 83 ms
15,808 KB
testcase_22 AC 93 ms
17,504 KB
testcase_23 AC 82 ms
15,816 KB
testcase_24 AC 89 ms
16,204 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

M=10**9+7
n,s,k=gets.split.map(&:to_i)
s-=k*n*(n-1)/2
if s<0
	p 0
	exit
end

dp=Array.new(2*20000,1)
w=1
(n-1).times{
	temp=Array.new(2*s,0)
	w+=1
	(s+1).times{|i|
		temp[i]=(temp[i-w]+dp[i])%M
	}
	dp=temp
}

p dp[s]
0