結果
問題 | No.3018 目隠し宝探し |
ユーザー |
![]() |
提出日時 | 2025-01-25 13:49:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 116 ms / 2,000 ms |
コード長 | 464 bytes |
コンパイル時間 | 2,160 ms |
コンパイル使用メモリ | 81,952 KB |
実行使用メモリ | 70,552 KB |
平均クエリ数 | 2.68 |
最終ジャッジ日時 | 2025-01-25 23:00:10 |
合計ジャッジ時間 | 4,844 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge8 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 21 |
ソースコード
h, w = map(int, input().split())if h == w == 1:print("!", 1, 1)elif h == 1:print("?", 1, 1)d = int(input())x = int(d ** (1/2))print("!", h, x+1)elif w == 1:print("?", 1, 1)d = int(input())x = int(d ** (1/2))print("!", x+1, w)else:print("?", 1, 1)d1 = int(input())print("?", 1, w)d2 = int(input())x = (w**2+d1-d2) // (2*w-2)dy = int((d1 - (x - 1) ** 2) ** (1/2))print("!", 1+dy, x)