結果

問題 No.871 かえるのうた
ユーザー tailstails
提出日時 2019-08-30 22:22:56
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 7,068 KB
実行使用メモリ 41,856 KB
最終ジャッジ日時 2024-05-01 18:37:54
合計ジャッジ時間 11,718 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
5,760 KB
testcase_01 WA -
testcase_02 AC 8 ms
6,016 KB
testcase_03 AC 9 ms
5,888 KB
testcase_04 AC 8 ms
5,888 KB
testcase_05 AC 9 ms
5,888 KB
testcase_06 WA -
testcase_07 AC 8 ms
5,888 KB
testcase_08 AC 27 ms
6,912 KB
testcase_09 AC 25 ms
7,040 KB
testcase_10 AC 11 ms
6,144 KB
testcase_11 AC 14 ms
6,272 KB
testcase_12 AC 115 ms
12,736 KB
testcase_13 AC 31 ms
7,296 KB
testcase_14 AC 571 ms
39,664 KB
testcase_15 AC 564 ms
39,512 KB
testcase_16 AC 604 ms
41,488 KB
testcase_17 AC 560 ms
37,368 KB
testcase_18 AC 104 ms
12,948 KB
testcase_19 WA -
testcase_20 AC 65 ms
8,704 KB
testcase_21 AC 253 ms
18,212 KB
testcase_22 AC 9 ms
5,760 KB
testcase_23 AC 9 ms
5,888 KB
testcase_24 AC 8 ms
5,888 KB
testcase_25 AC 20 ms
6,656 KB
testcase_26 AC 61 ms
9,472 KB
testcase_27 AC 88 ms
11,456 KB
testcase_28 AC 8 ms
5,760 KB
testcase_29 AC 312 ms
28,444 KB
testcase_30 AC 493 ms
31,612 KB
testcase_31 AC 24 ms
6,656 KB
testcase_32 AC 450 ms
29,608 KB
testcase_33 WA -
testcase_34 AC 176 ms
15,548 KB
testcase_35 AC 421 ms
27,564 KB
testcase_36 AC 621 ms
35,452 KB
testcase_37 AC 313 ms
20,148 KB
testcase_38 AC 745 ms
38,424 KB
testcase_39 WA -
testcase_40 AC 338 ms
29,236 KB
testcase_41 AC 8 ms
5,888 KB
testcase_42 AC 281 ms
29,232 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 8 ms
5,760 KB
testcase_47 AC 8 ms
5,888 KB
testcase_48 AC 8 ms
5,888 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use integer;
($n,$k)=glob<>;
@x=glob<>;
@a=glob<>;
--$k;
$l=$x[$k]-$a[$k];
$r=$x[$k]+$a[$k];
$i=$k-1;
$j=$k+1;
while(1){
	if($i>=0 && $x[$i]>=$l){
		$l=$x[$i]-$a[$i] if $l>$x[$i]-$a[$i];
		--$i;
	}
	elsif($j<$n && $x[$j]<=$r){
		$r=$x[$j]+$a[$j] if $r<$x[$j]+$a[$j];
		++$j;
	}
	else{
		last;
	}
}
print $j-$i-1;
0