結果

問題 No.343 手抜き工事のプロ
ユーザー tailstails
提出日時 2016-02-12 23:29:42
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 24,284 KB
最終ジャッジ日時 2023-10-22 03:34:50
合計ジャッジ時間 1,794 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,392 KB
testcase_01 AC 4 ms
5,392 KB
testcase_02 AC 4 ms
5,392 KB
testcase_03 AC 3 ms
5,392 KB
testcase_04 AC 3 ms
5,392 KB
testcase_05 AC 3 ms
5,392 KB
testcase_06 AC 3 ms
5,392 KB
testcase_07 AC 3 ms
5,392 KB
testcase_08 AC 3 ms
5,392 KB
testcase_09 AC 3 ms
5,392 KB
testcase_10 AC 3 ms
5,392 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 3 ms
5,408 KB
testcase_16 AC 3 ms
5,392 KB
testcase_17 AC 3 ms
5,392 KB
testcase_18 AC 3 ms
5,392 KB
testcase_19 AC 3 ms
5,392 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$n=<>;
$l=<>;
for$i(2..$n){
	$x[$i]=<>;
	exit!print-1 if abs($x[$i]-$x[$i-1])>=$l;
}
$c=0;
for$i(reverse 2..$n){
	$w+=$x[$n];
	++$c if not
		$x[$n-1]*($n-$i+1)<$w+$l/2*($n-$i+1) && $w+$l/2*($n-$i+1)<($x[$n-1]+$l)*($n-$i+1)
	&&	$x[$n-0]*($n-$i+1)<$w+$l/2*($n-$i+1) && $w+$l/2*($n-$i+1)<($x[$n-0]+$l)*($n-$i+1);
}
print$c
0