結果

問題 No.1429 Simple Dowsing
ユーザー 学ぶマン
提出日時 2025-03-24 18:47:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 82,720 KB
実行使用メモリ 70,632 KB
平均クエリ数 3.00
最終ジャッジ日時 2025-03-24 18:47:33
合計ジャッジ時間 2,920 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

# k 乗根
def sqrt(n: int, k = 2):
    l = k - 1
    if not n: return 0
    y = 1 << (n.bit_length() + l) // k
    x = y + 1
    while y < x:
        x = y
        y = (l * x + n // (x ** l)) // k
    return x

print('? 0 0', flush=True)
d1 = int(input())
print('? 100 0', flush=True)
d2 = int(input())

a = (d1 - d2 + 10**4)//200
b = sqrt(d1 - a**2)
print('!', a, b, flush=True)

0