結果

問題 No.15 カタログショッピング
ユーザー gigurururugigurururu
提出日時 2014-12-16 13:55:31
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 147 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 11,272 KB
実行使用メモリ 20,132 KB
最終ジャッジ日時 2023-09-02 14:55:43
合計ジャッジ時間 9,820 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,092 KB
testcase_01 AC 82 ms
15,284 KB
testcase_02 AC 89 ms
15,596 KB
testcase_03 AC 124 ms
20,132 KB
testcase_04 AC 84 ms
15,100 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,s=gets.split.map &:to_i
d={0=>[[]]}
n.times{|i|c=gets.to_i;d.dup.map{|k,v|d[k+c]=(d[k+c]||[])+v.map{|j|j+[i+1]}}}
puts d[s].sort.map{|i|i*" "}
0