結果
| 問題 | 
                            No.1429 Simple Dowsing
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-05-09 01:14:59 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 506 bytes | 
| コンパイル時間 | 235 ms | 
| コンパイル使用メモリ | 82,028 KB | 
| 実行使用メモリ | 84,136 KB | 
| 平均クエリ数 | 2.53 | 
| 最終ジャッジ日時 | 2024-11-25 14:38:18 | 
| 合計ジャッジ時間 | 2,566 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 RE * 5 | 
ソースコード
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()