結果

問題 No.15 カタログショッピング
ユーザー letrangerjpletrangerjp
提出日時 2017-05-27 03:23:55
言語 Ruby
(3.2.2)
結果
AC  
実行時間 293 ms / 5,000 ms
コード長 204 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 11,996 KB
実行使用メモリ 36,668 KB
最終ジャッジ日時 2023-10-20 00:23:53
合計ジャッジ時間 2,573 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
外部呼び出し有り
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
16,116 KB
testcase_01 AC 82 ms
16,116 KB
testcase_02 AC 80 ms
16,116 KB
testcase_03 AC 80 ms
16,116 KB
testcase_04 AC 79 ms
16,116 KB
testcase_05 AC 283 ms
36,396 KB
testcase_06 AC 290 ms
36,668 KB
testcase_07 AC 289 ms
36,396 KB
testcase_08 AC 293 ms
36,396 KB
testcase_09 AC 293 ms
36,396 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

eval"N,S,*P="+`dd`.split*?,;g=->f,t,s=0,r=[],h=(Hash.new{[]}){h[s]+=[r];(f...t).map{|i|g[i+1,t,s+P[i],r+[i+1],h]};h};L=g[N/2,N];g[0,N/2].map{|s,a|a.product(L[S-s]){|x,y|$*<<x+y}};puts$*.sort.map{|a|a*" "}
0