結果

問題 No.15 カタログショッピング
ユーザー なおなお
提出日時 2014-12-16 19:06:53
言語 Perl
(5.38.2)
結果
AC  
実行時間 163 ms / 5,000 ms
コード長 368 bytes
コンパイル時間 597 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 49,744 KB
最終ジャッジ日時 2023-09-02 15:20:47
合計ジャッジ時間 1,732 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,756 KB
testcase_01 AC 3 ms
4,656 KB
testcase_02 AC 3 ms
4,576 KB
testcase_03 AC 3 ms
4,748 KB
testcase_04 AC 2 ms
4,756 KB
testcase_05 AC 159 ms
49,744 KB
testcase_06 AC 163 ms
49,604 KB
testcase_07 AC 156 ms
49,644 KB
testcase_08 AC 158 ms
49,660 KB
testcase_09 AC 157 ms
49,452 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

<>=~/ /;$n=$`/2|0;$k=1;@j=@k=[0,0];
while($n--){$m=<>;map{push@j,[$_->[0]+$m,$_->[1]|$k]}@j;$k*=2;}
while($m=<>){map{push@k,[$_->[0]+$m,$_->[1]|$k]}@k;$k*=2;}
push@{$k{$_->[0]}},$_->[1]for@k;
for$a(@j){push@r,$_|$a->[1]for@{$k{$'-$a->[0]}}}
for(sort{$c=$a;$d=$b;$c>>=1,$d>>=1until(($c^$d)&1);($d&1)<=>($c&1)}@r){
for$i(1..32){print"$i "if($_&1);$_>>=1;}print$/;}
0