結果

問題 No.1429 Simple Dowsing
ユーザー 👑 H20H20
提出日時 2022-01-02 12:29:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 606 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 82,528 KB
実行使用メモリ 76,276 KB
平均クエリ数 3.00
最終ジャッジ日時 2024-04-19 18:14:52
合計ジャッジ時間 2,089 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
69,260 KB
testcase_01 AC 56 ms
69,004 KB
testcase_02 AC 53 ms
69,112 KB
testcase_03 AC 56 ms
75,340 KB
testcase_04 AC 56 ms
76,276 KB
testcase_05 AC 53 ms
69,228 KB
testcase_06 AC 57 ms
75,284 KB
testcase_07 AC 56 ms
74,592 KB
testcase_08 AC 56 ms
75,908 KB
testcase_09 AC 55 ms
75,568 KB
testcase_10 AC 53 ms
69,860 KB
testcase_11 AC 56 ms
75,808 KB
testcase_12 AC 55 ms
75,296 KB
testcase_13 AC 56 ms
75,084 KB
testcase_14 AC 54 ms
69,220 KB
権限があれば一括ダウンロードができます

ソースコード

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 = int(query(0,0))
zeroone = int(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(i,j)
            exit()





0