結果
問題 | No.553 AlphaCoder Rating |
ユーザー |
![]() |
提出日時 | 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 mathn = int(input())perfs = [int(input()) for _ in range(n)]if n == 0:print(0)else:# Calculate sum_denominator and sum_81sum_denominator = 9.0 * (1.0 - (0.9 ** n))sum_81 = 0.81 * (1.0 - (0.81 ** n)) / 0.19sqrt_sum_81 = math.sqrt(sum_81)F_n = sqrt_sum_81 / sum_denominator# Calculate F_infF_inf = math.sqrt(0.81 / 0.19) / 9.0 # Precomputed value for F(∞)F1 = 1.0 # F(1) is always 1.0numerator_f = F_n - F_infdenominator_f = F1 - F_inff_n = (numerator_f / denominator_f) * 1200.0# Calculate sum_gsum_g = 0.0for i in range(n):exponent = i + 1weight = 0.9 ** exponentperf = perfs[i]g_val = 2.0 ** (perf / 800.0)sum_g += g_val * weightavg_g = sum_g / sum_denominatorg_inv = 800.0 * math.log2(avg_g)rating = g_inv - f_n# Rounding to the nearest integer, considering the allowed errorprint(round(rating))