結果

問題 No.1429 Simple Dowsing
ユーザー miya145592miya145592
提出日時 2023-05-09 01:19:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 468 bytes
コンパイル時間 1,905 ms
コンパイル使用メモリ 86,556 KB
実行使用メモリ 91,756 KB
平均クエリ数 2.87
最終ジャッジ日時 2023-08-16 23:02:18
合計ジャッジ時間 4,024 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
91,604 KB
testcase_01 AC 105 ms
91,100 KB
testcase_02 AC 108 ms
91,484 KB
testcase_03 AC 106 ms
91,112 KB
testcase_04 AC 103 ms
91,576 KB
testcase_05 AC 107 ms
91,244 KB
testcase_06 AC 102 ms
91,732 KB
testcase_07 AC 106 ms
91,308 KB
testcase_08 AC 105 ms
91,460 KB
testcase_09 AC 107 ms
91,416 KB
testcase_10 AC 107 ms
91,096 KB
testcase_11 AC 105 ms
91,036 KB
testcase_12 AC 107 ms
91,660 KB
testcase_13 AC 106 ms
91,100 KB
testcase_14 AC 106 ms
91,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

print("? 0 0")
d = int(input())
S = set()
for a in range(101):
    for b in range(101):
        if a*a+b*b==d:
            S.add((a, b))
if len(S)==1:
    for a, b in S:
        print(f"! {a} {b}")
        exit()
for a, b in S:
    print(f"? {a} {b}")
    d2 = int(input())
    if d2==0:
        print(f"! {a} {b}")
        exit()
    else:
        for na, nb in S:
            if d2==(na-a)**2+(nb-b)**2:
                print(f"! {na} {nb}")
                exit()

0