結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,560 KB
testcase_01 AC 3 ms
4,720 KB
testcase_02 AC 3 ms
4,584 KB
testcase_03 AC 3 ms
4,660 KB
testcase_04 AC 3 ms
4,544 KB
testcase_05 AC 162 ms
49,424 KB
testcase_06 AC 163 ms
49,488 KB
testcase_07 AC 163 ms
49,664 KB
testcase_08 AC 165 ms
49,504 KB
testcase_09 AC 162 ms
49,464 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$r(sort{$c=$a;$d=$b;$c>>=1,$d>>=1until(($c^$d)&1);($d&1)<=>($c&1)}@r){print join(" ",grep{($r>>($_-1))&1}1..32),$/;}
0