結果

問題 No.553 AlphaCoder Rating
ユーザー nannanynannany
提出日時 2017-08-11 23:19:46
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 18 ms / 1,500 ms
コード長 851 bytes
コンパイル時間 466 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 8,132 KB
最終ジャッジ日時 2023-08-02 23:45:49
合計ジャッジ時間 1,880 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,032 KB
testcase_01 AC 17 ms
7,996 KB
testcase_02 AC 16 ms
8,100 KB
testcase_03 AC 16 ms
7,960 KB
testcase_04 AC 17 ms
8,084 KB
testcase_05 AC 16 ms
7,976 KB
testcase_06 AC 16 ms
8,004 KB
testcase_07 AC 16 ms
7,960 KB
testcase_08 AC 17 ms
8,120 KB
testcase_09 AC 18 ms
8,112 KB
testcase_10 AC 17 ms
7,976 KB
testcase_11 AC 17 ms
8,120 KB
testcase_12 AC 17 ms
8,132 KB
testcase_13 AC 17 ms
8,044 KB
testcase_14 AC 16 ms
8,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math


def F(n):
    mother = 0
    for i in range(1, n + 1):
        mother += 0.9 ** i

    child = 0
    for i in range(1, n + 1):
        child += 0.81 ** i
    child = math.sqrt(child)

    return child / mother


def f(n):
    sum_geometric_progression = math.sqrt(0.81 / 0.19) / 9
    return (F(n) - sum_geometric_progression) / (F(1) - sum_geometric_progression) * 1200


def g(X):
    return 2.0 ** (X / 800)


def g_inverse(X):
    return 800 * math.log(X, 2)


if __name__ == '__main__':
    N = int(input())
    RPerf = []
    for i in range(N):
        RPerf.append(int(input()))

    arg_mother = 0
    for i in range(1, N + 1):
        arg_mother += 0.9 ** i

    arg_child = 0
    for i in range(1, N + 1):
        arg_child += g(RPerf[i - 1]) * (0.9 ** i)
    ans = g_inverse(arg_child / arg_mother) - f(N)
    print(int(ans))
0