結果

問題 No.624 Santa Claus and The Last Dungeon
ユーザー tails
提出日時 2017-12-26 11:55:03
言語 Perl
(5.40.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 856 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 6,948 KB
実行使用メモリ 25,208 KB
平均クエリ数 399.28
最終ジャッジ日時 2024-07-16 15:12:47
合計ジャッジ時間 4,183 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます
コンパイルメッセージ
Possible precedence problem on bitwise ^ operator at Main.pl line 16.
Possible precedence problem on bitwise ^ operator at Main.pl line 30.
Possible precedence problem on bitwise ^ operator at Main.pl line 31.
Possible precedence problem on bitwise ^ operator at Main.pl line 36.
Possible precedence problem on bitwise ^ operator at Main.pl line 41.
Main.pl syntax OK

ソースコード

diff #

sub p{
	print"@_\n";
	(glob<>)[2];
}
$|=<>;
@k=0..99;
for(0..49){
	$d0=sprintf("%02d",$_*2);
	$d1=sprintf("%02d",$_*2+1);
	@kc=@k;
	while(1){
		$mc=$kc[@kc/2];
		$r=p+($d0)x$mc,($d1)x(100-$mc);
		last if $r!=1;
		$r=p+('??')x$mc,($d1)x(100-$mc);
		@kc=grep$r^$_<$mc,@kc;
	}
	($d0,$d1)=($d1,$d0)if!$r;
	@k0=@kc[0..@kc/2-1];
	@k1=@kc[@kc/2..$#kc];
	while(@k0>1&&@k1>1){
		$m0=$k0[@k0/2];
		$m1=$k1[@k1/2];
		$x=0;
		$r=p+($d0)x$m0,($d1)x($m1-$m0),($d0)x(100-$m1);
		if($r==1){
			$x=1;
			$r=p+($d0)x$m0,('??')x(100-$m0);
		}
		@k0=grep$r==0^$_<$m0,@k0;
		@k1=grep$r==$x^$_<$m1,@k1;
	}
	while(@k0>1){
		$m0=$k0[@k0/2];
		$r=p+('??')x$m0,($d0)x(100-$m0);
		@k0=grep$r^$_<$m0,@k0;
	}
	while(@k1>1){
		$m1=$k1[@k1/2];
		$r=p+('??')x$m1,($d1)x(100-$m1);
		@k1=grep$r^$_<$m1,@k1;
	}
	@k=grep{$_!=$k0[0]&&$_!=$k1[0]}@k;
	@a[$k0[0],$k1[0]]=($d0,$d1);
}
print"@a\n";
0