結果

問題 No.489 株に挑戦
ユーザー %20%20
提出日時 2017-02-27 13:41:38
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 438 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 5,380 KB
実行使用メモリ 42,060 KB
最終ジャッジ日時 2023-09-02 12:40:19
合計ジャッジ時間 10,586 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 472 ms
31,844 KB
testcase_01 AC 456 ms
27,452 KB
testcase_02 AC 61 ms
18,640 KB
testcase_03 AC 61 ms
18,652 KB
testcase_04 AC 61 ms
18,592 KB
testcase_05 AC 61 ms
18,540 KB
testcase_06 AC 62 ms
18,520 KB
testcase_07 AC 61 ms
18,676 KB
testcase_08 AC 61 ms
18,652 KB
testcase_09 AC 62 ms
18,576 KB
testcase_10 AC 61 ms
18,712 KB
testcase_11 AC 62 ms
18,776 KB
testcase_12 AC 61 ms
18,812 KB
testcase_13 AC 61 ms
18,580 KB
testcase_14 AC 61 ms
18,748 KB
testcase_15 AC 81 ms
19,444 KB
testcase_16 AC 790 ms
33,852 KB
testcase_17 AC 91 ms
20,900 KB
testcase_18 AC 409 ms
27,320 KB
testcase_19 AC 377 ms
25,500 KB
testcase_20 AC 788 ms
34,112 KB
testcase_21 AC 231 ms
22,340 KB
testcase_22 AC 102 ms
20,092 KB
testcase_23 AC 297 ms
28,048 KB
testcase_24 AC 894 ms
36,892 KB
testcase_25 AC 61 ms
18,556 KB
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Possible precedence problem on bitwise | operator at Main.pl line 5.
Main.pl syntax OK

ソースコード

diff #

sub max{$_[$_[1]>$_[0]]}
$b=2**17;
($N,$D,$K)=glob<>;
@x=((0)x$b,<>);
$x[$_]=$x[$_*2|$x[$_*2+1]>$x[$_*2]]for reverse 1..$b-1;
for(0..$N-1){
	($L,$R)=@x[($l,$r)=($b+$_,$b+$_+$D)];
	while($l>>1!=$r>>1){
		$l&1||($L=max($L,$x[$l^1]));
		$l>>=1;
		$r&1&&($R=max($R,$x[$r^1]));
		$r>>=1
	}
	if($-=max($L,$R)-$x[$b+$_]-$m){
		$j=$_;
		$m+=$-
	}
}
if($m){
	$k=$j;
	++$k until$x[$b+$k]-$x[$b+$j]==$m;
	print$m*$K,"\n$j $k\n"
}else{
	print 0,$/
}
0