結果

問題 No.1429 Simple Dowsing
ユーザー miya145592miya145592
提出日時 2023-05-09 01:14:59
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 506 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 94,724 KB
平均クエリ数 2.53
最終ジャッジ日時 2023-08-16 22:59:40
合計ジャッジ時間 4,075 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
91,332 KB
testcase_01 AC 98 ms
91,324 KB
testcase_02 AC 103 ms
91,532 KB
testcase_03 AC 101 ms
91,496 KB
testcase_04 AC 99 ms
91,732 KB
testcase_05 AC 99 ms
91,456 KB
testcase_06 AC 102 ms
91,692 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 100 ms
91,948 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 104 ms
91,632 KB
testcase_14 AC 102 ms
91,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

print("? 0 0")
d = int(input())
S = set()
T = None
for a in range(101):
    for b in range(101):
        if a*a+b*b==d:
            if a==b:
                T = (a, b)
            else:
                S.add((a, b))
if T is not None and len(S)==0:
    print(f"! {T[0]} {T[1]}")
    exit()
for a, b in S:
    print(f"? {a} {b}")
    d2 = int(input())
    if d2==0:
        print(f"! {a} {b}")
    elif d2==(a-b)**2+(b-a)**2:
        print(f"! {b} {a}")
    else:
        print(f"! {T[0]} {T[1]}")
    exit()
0