結果
| 問題 | No.3018 目隠し宝探し |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-26 20:51:43 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 75 ms / 2,000 ms |
| コード長 | 485 bytes |
| 記録 | |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 85,204 KB |
| 実行使用メモリ | 73,680 KB |
| 平均クエリ数 | 2.68 |
| 最終ジャッジ日時 | 2026-05-26 20:51:48 |
| 合計ジャッジ時間 | 3,743 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 21 |
ソースコード
h,w=map(int,input().split())
if h==1 and w==1:
print("!",1,1);exit()
print("?",1,1)
d1=int(input())
v={}
for i in range(max(h,w)):
v[i**2]=i
for i in range(max(h,w)+1):
if min(h,w)==1 and i**2==d1:
if h==1:
print("!",1,1+i)
else:
print("!",i+1,1)
exit()
print("?",1,w)
d2=int(input())
for i in range(1,w+1):
if d1-(1-i)**2 in v and d2-(w-i)**2 in v and v[d1-(i-1)**2]==v[d2-(w-i)**2]:
print("!",1+v[d1-(1-i)**2],i);exit()