結果

問題 No.3018 目隠し宝探し
ユーザー みねしみねみね
提出日時 2025-08-12 21:26:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 575 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 27,776 KB
平均クエリ数 2.64
最終ジャッジ日時 2025-08-12 21:26:17
合計ジャッジ時間 9,993 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 8 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
h,w = map(int,input().split())
if h == w == 1: exit(print('!',1,1))

print('?',1,1)
d1 = int(input())
if h == 1: exit(print('!',1,1+(int)(math.sqrt(d1))))
if w == 1: exit(print('!',1+(int)(math.sqrt(d1)),1))
if d1 == 0: exit(print('!',1,1))

print('?',h,w)
dn = int(input())
if dn == 0: exit(print('!',h,w))

print('?',1,w)
d = int(input())
if d == 0: exit(print('!',1,w))

for r in range(h):
  for c in range(w):
    e1, en, e = r**2 + c**2, (h - 1 - r)**2 + (w - 1 - c)**2, r**2 + (w - 1 - c)**2
    if e1 == d1 and en == dn and e == d: exit(print('!',r+1,c+1))
0