結果
| 問題 |
No.1429 Simple Dowsing
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-09 01:19:41 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 61 ms / 2,000 ms |
| コード長 | 468 bytes |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 82,636 KB |
| 実行使用メモリ | 76,152 KB |
| 平均クエリ数 | 2.87 |
| 最終ジャッジ日時 | 2024-11-25 14:42:38 |
| 合計ジャッジ時間 | 2,061 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
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()