結果

問題 No.1150 シュークリームゲーム(Easy)
ユーザー tailstails
提出日時 2020-08-07 22:53:42
言語 Perl
(5.38.0)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 6,156 KB
実行使用メモリ 30,812 KB
最終ジャッジ日時 2023-10-25 03:48:40
合計ジャッジ時間 8,491 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
6,152 KB
testcase_01 AC 8 ms
6,152 KB
testcase_02 AC 8 ms
6,152 KB
testcase_03 AC 7 ms
6,156 KB
testcase_04 AC 8 ms
6,156 KB
testcase_05 AC 8 ms
6,152 KB
testcase_06 AC 7 ms
6,152 KB
testcase_07 AC 8 ms
6,152 KB
testcase_08 AC 8 ms
6,156 KB
testcase_09 AC 8 ms
6,156 KB
testcase_10 AC 7 ms
6,152 KB
testcase_11 AC 7 ms
6,152 KB
testcase_12 AC 8 ms
6,152 KB
testcase_13 AC 8 ms
6,148 KB
testcase_14 AC 8 ms
6,152 KB
testcase_15 AC 7 ms
6,152 KB
testcase_16 AC 8 ms
6,152 KB
testcase_17 AC 7 ms
6,152 KB
testcase_18 AC 8 ms
6,152 KB
testcase_19 AC 8 ms
6,152 KB
testcase_20 AC 8 ms
6,152 KB
testcase_21 AC 8 ms
6,152 KB
testcase_22 AC 226 ms
26,380 KB
testcase_23 AC 233 ms
26,840 KB
testcase_24 AC 219 ms
25,208 KB
testcase_25 AC 232 ms
26,144 KB
testcase_26 AC 260 ms
28,500 KB
testcase_27 AC 268 ms
29,020 KB
testcase_28 AC 289 ms
29,688 KB
testcase_29 AC 243 ms
25,824 KB
testcase_30 AC 266 ms
27,564 KB
testcase_31 AC 265 ms
26,812 KB
testcase_32 AC 265 ms
26,272 KB
testcase_33 AC 279 ms
27,632 KB
testcase_34 AC 297 ms
28,528 KB
testcase_35 AC 301 ms
29,056 KB
testcase_36 AC 317 ms
29,472 KB
testcase_37 AC 317 ms
29,680 KB
testcase_38 AC 283 ms
25,944 KB
testcase_39 AC 279 ms
25,988 KB
testcase_40 AC 312 ms
27,492 KB
testcase_41 AC 330 ms
29,176 KB
testcase_42 AC 175 ms
30,812 KB
testcase_43 AC 174 ms
30,812 KB
testcase_44 AC 178 ms
29,668 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;$g=1;
($s,$t,$g)=($t,$s,-1)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*=$g;
$z+=abs(($a==$d?0:$a[$d%$n])-($c==$b-$n?0:$a[$b%$n]));
print $z;
0