結果
| 問題 | No.3181 find H | 
| コンテスト | |
| ユーザー |  Prala | 
| 提出日時 | 2025-06-13 23:13:23 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 881 bytes | 
| コンパイル時間 | 388 ms | 
| コンパイル使用メモリ | 82,828 KB | 
| 実行使用メモリ | 67,472 KB | 
| 最終ジャッジ日時 | 2025-06-13 23:13:28 | 
| 合計ジャッジ時間 | 4,359 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 1 | 
| other | TLE * 1 -- * 49 | 
ソースコード
import math
def IM(): return map(int, input().split())
def IL()->list[int]: return [int(i) for i in input().split()]
R, Gx, Gy = IM()
r = math.sqrt(Gx**2 + Gy**2)
b = (3*r-R)/2
a = math.sqrt(R**2 - b**2)
s = b+(a**2/(R-b))
#print(s)
if s < 10**9:
    s = 0
if Gy == 0:
    print(s, 0)
    exit()
def keyfunc(n:float)->bool:
    global Gx, Gy
    ans_x = n
    ans_y = ans_x/(Gx/Gy)
    if math.sqrt(ans_x**2+ans_y**2) > abs(s):
        return True
    return False
def binary_search(key = keyfunc, MX = 2**62+2**61)->int:
    ng = -10**(-8)
    ok = MX
    while abs(ok - ng) > 10**(-8):
        mid = (ok+ng)/2
        if key(mid):
            ok = mid
        else:
            ng = mid
    return ok
binary_ans = binary_search()
if (s >= 0 and Gx >= 0) or (s <= 0 and Gx <= 0):
    print(binary_ans, binary_ans/(Gx/Gy))
else:
    print(-binary_ans, -binary_ans/(Gx/Gy))
            
            
            
        