結果

問題 No.1429 Simple Dowsing
ユーザー 👑 H20H20
提出日時 2022-01-02 12:27:31
言語 PyPy3
(7.3.15)
結果
QLE  
実行時間 -
コード長 575 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 75,480 KB
平均クエリ数 2.00
最終ジャッジ日時 2024-04-19 18:12:38
合計ジャッジ時間 2,301 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 QLE -
testcase_01 QLE -
testcase_02 QLE -
testcase_03 QLE -
testcase_04 QLE -
testcase_05 QLE -
testcase_06 QLE -
testcase_07 QLE -
testcase_08 QLE -
testcase_09 QLE -
testcase_10 QLE -
testcase_11 QLE -
testcase_12 QLE -
testcase_13 QLE -
testcase_14 QLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline
write = sys.stdout.write
flush = sys.stdout.flush

# クエリ: "? x1 x2" を出力
def query(x1, x2):
    write("? %d %d\n" % (x1, x2))
    flush()
    # ジャッジから返される値を取得
    return readline().strip()

# 回答: "! x" を出力
def answer(x1, x2):
    write("! %d %d\n" % (x1, x2))
    flush()
    # 即時終了
    exit(0)

zerozero =  query(0,0)
zeroone = query(0,1)

for i in range(101):
    for j in range(101):
        if i**2+j**2 ==zerozero and (i-0)**2+(j-1)**2==zeroone:
            answer()





0