結果
| 問題 |
No.553 AlphaCoder Rating
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 20:25:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 1,500 ms |
| コード長 | 963 bytes |
| コンパイル時間 | 149 ms |
| コンパイル使用メモリ | 82,796 KB |
| 実行使用メモリ | 54,676 KB |
| 最終ジャッジ日時 | 2025-03-20 20:26:32 |
| 合計ジャッジ時間 | 1,558 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
import math
n = int(input())
perfs = [int(input()) for _ in range(n)]
if n == 0:
print(0)
else:
# Calculate sum_denominator and sum_81
sum_denominator = 9.0 * (1.0 - (0.9 ** n))
sum_81 = 0.81 * (1.0 - (0.81 ** n)) / 0.19
sqrt_sum_81 = math.sqrt(sum_81)
F_n = sqrt_sum_81 / sum_denominator
# Calculate F_inf
F_inf = math.sqrt(0.81 / 0.19) / 9.0 # Precomputed value for F(∞)
F1 = 1.0 # F(1) is always 1.0
numerator_f = F_n - F_inf
denominator_f = F1 - F_inf
f_n = (numerator_f / denominator_f) * 1200.0
# Calculate sum_g
sum_g = 0.0
for i in range(n):
exponent = i + 1
weight = 0.9 ** exponent
perf = perfs[i]
g_val = 2.0 ** (perf / 800.0)
sum_g += g_val * weight
avg_g = sum_g / sum_denominator
g_inv = 800.0 * math.log2(avg_g)
rating = g_inv - f_n
# Rounding to the nearest integer, considering the allowed error
print(round(rating))
lam6er