結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,404 KB
testcase_01 AC 3 ms
5,404 KB
testcase_02 AC 4 ms
5,404 KB
testcase_03 AC 3 ms
5,404 KB
testcase_04 AC 3 ms
5,404 KB
testcase_05 AC 3 ms
5,404 KB
testcase_06 AC 3 ms
5,404 KB
testcase_07 AC 3 ms
5,404 KB
testcase_08 AC 3 ms
5,404 KB
testcase_09 AC 3 ms
5,404 KB
testcase_10 AC 3 ms
5,404 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 3 ms
5,420 KB
testcase_16 AC 3 ms
5,404 KB
testcase_17 AC 4 ms
5,404 KB
testcase_18 AC 4 ms
5,404 KB
testcase_19 AC 3 ms
5,404 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);
}
print$c
0