結果
| 問題 |
No.1305 Speak of the Devil
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-02 01:07:16 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 2,000 ms |
| コード長 | 347 bytes |
| コンパイル時間 | 268 ms |
| コンパイル使用メモリ | 82,384 KB |
| 実行使用メモリ | 54,220 KB |
| 最終ジャッジ日時 | 2024-09-13 03:36:52 |
| 合計ジャッジ時間 | 2,112 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 |
ソースコード
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)