結果
| 問題 | No.1429 Simple Dowsing |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-09 01:14:59 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 506 bytes |
| 記録 | |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 85,784 KB |
| 平均クエリ数 | 2.53 |
| 最終ジャッジ日時 | 2026-05-20 04:53:37 |
| 合計ジャッジ時間 | 4,066 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()