結果

問題 No.15 カタログショッピング
ユーザー letrangerjpletrangerjp
提出日時 2017-05-27 03:28:08
言語 Ruby
(3.2.2)
結果
AC  
実行時間 292 ms / 5,000 ms
コード長 202 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 12,044 KB
実行使用メモリ 35,556 KB
最終ジャッジ日時 2023-10-20 00:23:59
合計ジャッジ時間 2,607 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
外部呼び出し有り
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
16,084 KB
testcase_01 AC 92 ms
16,084 KB
testcase_02 AC 86 ms
16,084 KB
testcase_03 AC 88 ms
16,084 KB
testcase_04 AC 87 ms
16,080 KB
testcase_05 AC 292 ms
35,484 KB
testcase_06 AC 283 ms
35,404 KB
testcase_07 AC 281 ms
35,556 KB
testcase_08 AC 283 ms
35,552 KB
testcase_09 AC 280 ms
35,556 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