結果

問題 No.1150 シュークリームゲーム(Easy)
ユーザー tailstails
提出日時 2020-08-07 22:01:21
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 726 ms
コンパイル使用メモリ 6,112 KB
実行使用メモリ 30,796 KB
最終ジャッジ日時 2023-10-25 01:05:11
合計ジャッジ時間 8,629 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
6,144 KB
testcase_01 AC 7 ms
6,144 KB
testcase_02 WA -
testcase_03 AC 7 ms
6,140 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 7 ms
6,140 KB
testcase_08 AC 8 ms
6,148 KB
testcase_09 AC 7 ms
6,144 KB
testcase_10 AC 8 ms
6,140 KB
testcase_11 WA -
testcase_12 AC 8 ms
6,144 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 7 ms
6,144 KB
testcase_16 AC 8 ms
6,144 KB
testcase_17 AC 7 ms
6,144 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 227 ms
26,364 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 229 ms
26,132 KB
testcase_26 AC 255 ms
28,488 KB
testcase_27 AC 264 ms
29,000 KB
testcase_28 WA -
testcase_29 AC 240 ms
25,808 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 283 ms
28,516 KB
testcase_35 AC 294 ms
29,036 KB
testcase_36 AC 304 ms
29,456 KB
testcase_37 WA -
testcase_38 AC 286 ms
25,928 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 174 ms
30,796 KB
testcase_43 AC 176 ms
30,796 KB
testcase_44 AC 179 ms
29,652 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

sub f{
	my($i,$j,$s)=@_;
	$s+=$a[$_%$n]for$i..$j-1;
	$s
}


$n=<>;
($s,$t)=glob<>;
--$s;--$t;
($s,$t)=($t,$s)if$s>$t;
@a=glob<>;

$z=f($a=$s+$t+$n+2>>1,$b=$s+$t+$n*2+1>>1)- f($c=$s+$t+2>>1,$d=$s+$t+$n+1>>1);

$z+=abs(($a==$d?0:$a[$d])-($c==$b-$n?0:$a[$b-$n]));
print $z;
0