結果
| 問題 |
No.3018 目隠し宝探し
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-01-25 14:28:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 494 bytes |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 82,644 KB |
| 実行使用メモリ | 154,376 KB |
| 平均クエリ数 | 2.23 |
| 最終ジャッジ日時 | 2025-01-25 23:20:58 |
| 合計ジャッジ時間 | 5,251 ms |
|
ジャッジサーバーID (参考情報) |
judge10 / judge9 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 WA * 2 RE * 9 |
ソースコード
import sys
def debug(*args):
print(*args, file=sys.stderr)
h, w = map(int, input().split())
cdds = [(i, j) for i in range(1, h+1) for j in range(1, h+1)]
asks = [(1, h), (h, w), (1, 1)]
while len(cdds) > 1 and asks:
new_cdds = []
ai, aj = asks.pop()
print('?', ai, aj)
d = int(input())
for i, j in cdds:
if (i-ai) ** 2 + (j-aj) ** 2 == d:
new_cdds.append((i, j))
cdds, new_cdds = new_cdds, cdds
# debug('d', cdds)
print('!', *cdds[0])