結果

問題 No.3018 目隠し宝探し
ユーザー kazuppa
提出日時 2025-02-07 17:01:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 71,164 KB
平均クエリ数 2.68
最終ジャッジ日時 2025-02-07 17:01:21
合計ジャッジ時間 4,052 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w=map(int, input().split())
if h==w==1:
  print("!",1,1)
elif h==1:
  print("?",1,1)
  d=int(input())
  print("!",h,int(d**(1/2))+1)
elif w==1:
  print("?",1,1)
  d=int(input())
  print("!",int(d**(1/2))+1, w)
else:
  print("?",1,1)
  d1=int(input())
  print("?",1,w)
  d2=int(input())
  x=(w**2+d1-d2)//(2*w-2)
  print("!",1+int((d1-(x-1)**2)**(1/2)),x)
0