結果

問題 No.3018 目隠し宝探し
コンテスト
ユーザー ntuda
提出日時 2025-11-05 23:07:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 82,408 KB
実行使用メモリ 70,772 KB
平均クエリ数 2.68
最終ジャッジ日時 2025-11-05 23:07:37
合計ジャッジ時間 4,838 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
if H == 1 and W == 1:
    print("!", 1, 1)
elif H == 1:
    print("?", 1, 1)
    a = int(input())
    print(1, round(a,0) - 1)
elif W == 1:
    print("?", 1, 1)
    a = int(input())
    print(round(a,0) - 1, 1)
else:
    W1 = W - 1
    print("?", 1, 1)
    d1 = int(input())
    print("?", 1, W)
    d2 = int(input())
    x1 = int(round((d1 - d2 + W1 ** 2) / 2 / W1,0))
    y = int(round((d1 - x1 ** 2)**0.5,0))
    print("!", y+1, x1+1)
0