結果
| 問題 |
No.553 AlphaCoder Rating
|
| コンテスト | |
| ユーザー |
yuruhiya
|
| 提出日時 | 2021-02-22 20:38:31 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 90 ms / 1,500 ms |
| コード長 | 385 bytes |
| コンパイル時間 | 143 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,544 KB |
| 最終ジャッジ日時 | 2024-09-21 16:18:41 |
| 合計ジャッジ時間 | 2,470 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
コンパイルメッセージ
Syntax OK
ソースコード
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
yuruhiya