結果

問題 No.731 等差数列がだいすき
ユーザー tailstails
提出日時 2018-09-07 21:36:28
言語 Perl
(5.38.2)
結果
AC  
実行時間 8 ms / 1,500 ms
コード長 171 bytes
コンパイル時間 1,458 ms
コンパイル使用メモリ 5,364 KB
実行使用メモリ 5,624 KB
最終ジャッジ日時 2023-08-19 12:51:24
合計ジャッジ時間 2,219 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,308 KB
testcase_01 AC 5 ms
5,148 KB
testcase_02 AC 5 ms
5,200 KB
testcase_03 AC 6 ms
5,248 KB
testcase_04 AC 6 ms
5,340 KB
testcase_05 AC 6 ms
5,252 KB
testcase_06 AC 7 ms
5,320 KB
testcase_07 AC 7 ms
5,400 KB
testcase_08 AC 7 ms
5,400 KB
testcase_09 AC 7 ms
5,316 KB
testcase_10 AC 8 ms
5,492 KB
testcase_11 AC 5 ms
5,300 KB
testcase_12 AC 5 ms
5,340 KB
testcase_13 AC 6 ms
5,520 KB
testcase_14 AC 7 ms
5,416 KB
testcase_15 AC 7 ms
5,492 KB
testcase_16 AC 6 ms
5,308 KB
testcase_17 AC 7 ms
5,384 KB
testcase_18 AC 8 ms
5,624 KB
testcase_19 AC 8 ms
5,504 KB
testcase_20 AC 8 ms
5,484 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$n=<>;
@a=glob<>;
$d=$_-($n-1)/2,$s+=$a[$_],$t+=$a[$_]*$d,$u+=$d*$d for 0..$n-1;
$a=$t/$u;
$b=$s/$n-$a*($n-1)/2;
$c+=($a*$_+$b-$a[$_])**2 for 0..$n-1;
print$b,$",$a,$/,$c;
0