結果

問題 No.617 Nafmo、買い出しに行く
ユーザー cielciel
提出日時 2017-12-24 22:41:42
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 125 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 11,492 KB
実行使用メモリ 37,464 KB
最終ジャッジ日時 2023-08-22 18:06:40
合計ジャッジ時間 9,281 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 651 ms
20,740 KB
testcase_01 AC 80 ms
15,256 KB
testcase_02 AC 885 ms
20,840 KB
testcase_03 TLE -
testcase_04 AC 198 ms
17,276 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n,k,*a=`dd`.split.map &:to_i
bag=[0]+[-Float::INFINITY]*k
a.each{|e|k.downto(e){|i|bag[i]=[bag[i],bag[i-e]+e].max}}
p bag.max
0