結果

問題 No.553 AlphaCoder Rating
ユーザー はむ吉🐹はむ吉🐹
提出日時 2017-08-13 16:31:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 30 ms / 1,500 ms
コード長 749 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-21 10:18:53
合計ジャッジ時間 1,230 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,752 KB
testcase_01 AC 27 ms
10,880 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 27 ms
10,752 KB
testcase_06 AC 28 ms
10,880 KB
testcase_07 AC 27 ms
10,752 KB
testcase_08 AC 28 ms
10,880 KB
testcase_09 AC 28 ms
10,752 KB
testcase_10 AC 28 ms
10,752 KB
testcase_11 AC 27 ms
10,880 KB
testcase_12 AC 28 ms
10,752 KB
testcase_13 AC 28 ms
10,752 KB
testcase_14 AC 28 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0