結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
15,236 KB
testcase_01 AC 78 ms
15,584 KB
testcase_02 AC 78 ms
15,024 KB
testcase_03 AC 95 ms
32,336 KB
testcase_04 AC 163 ms
27,148 KB
testcase_05 AC 79 ms
18,136 KB
testcase_06 AC 100 ms
46,444 KB
testcase_07 AC 325 ms
46,812 KB
testcase_08 AC 75 ms
16,396 KB
testcase_09 AC 73 ms
15,084 KB
testcase_10 RE -
testcase_11 AC 97 ms
18,312 KB
testcase_12 AC 78 ms
15,088 KB
testcase_13 AC 109 ms
23,048 KB
testcase_14 AC 79 ms
15,696 KB
testcase_15 AC 103 ms
20,832 KB
testcase_16 AC 75 ms
15,128 KB
testcase_17 AC 75 ms
15,088 KB
testcase_18 AC 166 ms
37,736 KB
testcase_19 AC 107 ms
25,864 KB
testcase_20 AC 82 ms
16,816 KB
testcase_21 AC 80 ms
15,904 KB
testcase_22 AC 96 ms
22,792 KB
testcase_23 AC 83 ms
21,352 KB
testcase_24 AC 84 ms
16,920 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*s,1)
w=1
(n-1).times{
	temp=Array.new(2*20000,0)
	w+=1
	(s+1).times{|i|
		temp[i]=(temp[i-w]+dp[i])%M
	}
	dp=temp
}

p dp[s]
0