結果
問題 |
No.553 AlphaCoder Rating
|
ユーザー |
![]() |
提出日時 | 2017-08-13 16:31:59 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 1,500 ms |
コード長 | 749 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-10-13 09:06:09 |
合計ジャッジ時間 | 1,289 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
import math def capital_f(n): k = 0.81 / 0.19 ll = 0.9 / 0.1 if math.isinf(n): return math.sqrt(k) / ll else: return math.sqrt(k * (1 - 0.81 ** n)) / (ll * (1 - 0.9 ** n)) def small_f(n): res = 1200 * (capital_f(n) - capital_f(math.inf)) res /= capital_f(1) - capital_f(math.inf) return res def g(x): return 2.0 ** (x / 800) def inv_g(x): return 800 * math.log2(x) def rating(n, ps): in_par = sum(g(ps[i]) * (0.9 ** (i + 1)) for i in range(n)) in_par /= sum(0.9 ** (i + 1) for i in range(n)) return round(inv_g(in_par) - small_f(n)) def main(): n = int(input()) ps = [int(input()) for _ in range(n)] print(rating(n, ps)) if __name__ == "__main__": main()