結果

問題 No.837 Noelちゃんと星々2
ユーザー %20%20
提出日時 2019-06-15 09:44:36
言語 Perl
(5.38.0)
結果
AC  
実行時間 480 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 776 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 36,004 KB
最終ジャッジ日時 2023-09-02 07:24:42
合計ジャッジ時間 6,777 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 366 ms
35,928 KB
testcase_01 AC 450 ms
35,912 KB
testcase_02 AC 454 ms
36,004 KB
testcase_03 AC 459 ms
35,832 KB
testcase_04 AC 468 ms
35,832 KB
testcase_05 AC 458 ms
35,984 KB
testcase_06 AC 474 ms
35,932 KB
testcase_07 AC 468 ms
35,852 KB
testcase_08 AC 480 ms
35,872 KB
testcase_09 AC 6 ms
5,128 KB
testcase_10 AC 6 ms
5,116 KB
testcase_11 AC 6 ms
5,408 KB
testcase_12 AC 6 ms
5,232 KB
testcase_13 AC 6 ms
5,228 KB
testcase_14 AC 6 ms
5,312 KB
testcase_15 AC 6 ms
5,232 KB
testcase_16 AC 6 ms
5,232 KB
testcase_17 AC 6 ms
5,228 KB
testcase_18 AC 6 ms
5,104 KB
testcase_19 AC 5 ms
5,392 KB
testcase_20 AC 6 ms
5,232 KB
testcase_21 AC 6 ms
5,128 KB
testcase_22 AC 6 ms
5,312 KB
testcase_23 AC 6 ms
5,108 KB
testcase_24 AC 6 ms
5,108 KB
testcase_25 AC 6 ms
5,232 KB
testcase_26 AC 6 ms
5,232 KB
testcase_27 AC 6 ms
5,328 KB
testcase_28 AC 6 ms
5,184 KB
testcase_29 AC 6 ms
5,324 KB
testcase_30 AC 6 ms
5,296 KB
testcase_31 AC 6 ms
5,232 KB
testcase_32 AC 6 ms
5,232 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$N=<>;
@s=(0,map$s+=$_,@Y=sort{$a-$b}glob<>);
$%=1e18;
for$i(1..$N-1){
	$j= 0+$i>>1;
	$k=$i+$N>>1;
	$t=
		$Y[$j]*($j- 0)-($s[$j]-$s[ 0])+($s[$i]-$s[$j])-$Y[$j]*($i-$j)+
		$Y[$k]*($k-$i)-($s[$k]-$s[$i])+($s[$N]-$s[$k])-$Y[$k]*($N-$k);
	$%=$t if$t<$%
}
print$Y[0]==$Y[-1]||$%,$/
0