結果

問題 No.553 AlphaCoder Rating
ユーザー yuruhiyayuruhiya
提出日時 2021-02-22 20:38:31
言語 Ruby
(3.3.0)
結果
AC  
実行時間 92 ms / 1,500 ms
コード長 385 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 11,948 KB
実行使用メモリ 16,212 KB
最終ジャッジ日時 2023-10-21 15:04:35
合計ジャッジ時間 2,703 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
16,212 KB
testcase_01 AC 88 ms
16,212 KB
testcase_02 AC 87 ms
16,212 KB
testcase_03 AC 88 ms
16,212 KB
testcase_04 AC 92 ms
16,212 KB
testcase_05 AC 89 ms
16,212 KB
testcase_06 AC 90 ms
16,212 KB
testcase_07 AC 87 ms
16,212 KB
testcase_08 AC 87 ms
16,212 KB
testcase_09 AC 88 ms
16,212 KB
testcase_10 AC 87 ms
16,212 KB
testcase_11 AC 87 ms
16,212 KB
testcase_12 AC 87 ms
16,212 KB
testcase_13 AC 87 ms
16,212 KB
testcase_14 AC 88 ms
16,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

X = Math.sqrt(4.263158) / 9.0
def f_(n)
	Math.sqrt((1..n).sum { 0.81**_1 }) / (1..n).sum { 0.9**_1 }
end
def f(n)
	(f_(n) - X) / (f_(1) - X) * 1200
end
def g(x)
	2.0**(x / 800.0)
end
def g_(x)
	800 * Math.log10(x) / Math.log10(2)
end

n = gets.to_i
a = (1..n).map { gets.to_f }
val = (1..n).sum { |i| g(a[i - 1]) * 0.9**i } / (1..n).sum { 0.9**_1 }
ans = g_(val) - f(n)
puts ans.round
0