結果
| 問題 |
No.3018 目隠し宝探し
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-08-12 21:05:45 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 606 bytes |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 12,160 KB |
| 実行使用メモリ | 28,672 KB |
| 平均クエリ数 | 3.41 |
| 最終ジャッジ日時 | 2025-08-12 21:05:50 |
| 合計ジャッジ時間 | 4,885 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | AC * 5 RE * 16 |
ソースコード
import math
h,w = map(int,input().split())
if h < w:
l,r = 1,h
while 1 < r - l:
ml, mr = (l * 2 + r) // 3, (r * 2 + l) // 3
print('?',ml,1)
dl = int(input())
print('?',mr,1)
dr = int(input())
if dl <= dr: r = mr
else: l = ml
print('?', l, 1)
d = int(input())
d = (int)(math.sqrt(d))
exit(print('!',l,1+d))
else:
l,r = 1,w
while 1 < r - l:
ml, mr = (l * 2 + r) // 3, (r * 2 + l) // 3
print('?',1,ml)
dl = int(input())
print('?',1,mr)
dr = int(input())
if dl <= dr: r = mr
else: l = ml
print('?', l, 1)
d = int(input())
d = (int)(math.sqrt(d))
exit(print('!',1+d,l))