結果

問題 No.1305 Speak of the Devil
ユーザー shotoyooshotoyoo
提出日時 2020-12-02 01:07:16
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 1,326 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 71,648 KB
最終ジャッジ日時 2023-10-11 04:13:35
合計ジャッジ時間 3,873 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,436 KB
testcase_01 AC 75 ms
71,248 KB
testcase_02 AC 73 ms
71,232 KB
testcase_03 AC 73 ms
71,116 KB
testcase_04 AC 73 ms
71,248 KB
testcase_05 AC 73 ms
71,224 KB
testcase_06 AC 76 ms
71,328 KB
testcase_07 AC 74 ms
71,512 KB
testcase_08 AC 74 ms
71,572 KB
testcase_09 AC 74 ms
71,452 KB
testcase_10 AC 74 ms
71,456 KB
testcase_11 AC 75 ms
71,332 KB
testcase_12 AC 73 ms
71,252 KB
testcase_13 AC 73 ms
71,476 KB
testcase_14 AC 73 ms
71,648 KB
testcase_15 AC 72 ms
71,624 KB
testcase_16 AC 72 ms
71,224 KB
testcase_17 AC 73 ms
71,080 KB
testcase_18 AC 73 ms
71,216 KB
testcase_19 AC 73 ms
71,580 KB
testcase_20 AC 74 ms
71,244 KB
testcase_21 AC 74 ms
71,624 KB
testcase_22 AC 73 ms
71,320 KB
testcase_23 AC 74 ms
71,252 KB
testcase_24 AC 73 ms
71,224 KB
testcase_25 AC 74 ms
71,476 KB
testcase_26 AC 75 ms
71,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

p,q = list(map(int, input().split()))
l = 0
r = 10**9
def sub(x):
    return x<min(q, 1/p + (1-1/p)*(x+1))
for _ in range(100):
    m = (l+r)/2
    if sub(m):
        l = m
    else:
        r = m
print(l)
0