結果

問題 No.1042 愚直大学
ユーザー fuppy_kyoprofuppy_kyopro
提出日時 2020-05-01 21:43:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 102,940 KB
最終ジャッジ日時 2023-08-26 08:50:24
合計ジャッジ時間 45,504 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,761 ms
99,384 KB
testcase_01 AC 1,792 ms
100,652 KB
testcase_02 AC 1,699 ms
101,528 KB
testcase_03 AC 1,846 ms
100,984 KB
testcase_04 AC 1,813 ms
102,020 KB
testcase_05 AC 1,799 ms
100,388 KB
testcase_06 AC 1,710 ms
101,100 KB
testcase_07 AC 1,710 ms
99,812 KB
testcase_08 AC 1,811 ms
100,172 KB
testcase_09 AC 1,567 ms
100,928 KB
testcase_10 AC 1,808 ms
100,828 KB
testcase_11 AC 1,753 ms
102,940 KB
testcase_12 AC 1,769 ms
101,316 KB
testcase_13 AC 1,700 ms
99,752 KB
testcase_14 AC 1,719 ms
100,252 KB
testcase_15 AC 1,742 ms
100,588 KB
testcase_16 AC 1,693 ms
99,960 KB
testcase_17 AC 1,690 ms
102,488 KB
testcase_18 AC 1,802 ms
100,688 KB
testcase_19 AC 1,737 ms
100,720 KB
testcase_20 AC 1,799 ms
102,000 KB
testcase_21 AC 1,844 ms
100,804 KB
testcase_22 AC 1,795 ms
102,120 KB
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
from decimal import Decimal


def check(n, p, q):
    if n / q >= 100:
         return False
    a = p + q * n * Decimal.ln(n) / Decimal.ln(Decimal(2))
    b = n * n
    return b <= a

def main():
    P, Q = map(int, input().split())
    p, q = Decimal(P), Decimal(Q)

    ok, ng = Decimal(1), Decimal(1e16)
    for _ in range(10000):
        n = (ok + ng) / Decimal(2)
        if check(n, p, q):
            ok = n
        else:
            ng = n
    print(ok)


if __name__ == '__main__':
    main()
0