結果
| 問題 | No.3018 目隠し宝探し | 
| コンテスト | |
| ユーザー |  eve__fuyuki | 
| 提出日時 | 2025-02-02 14:46:44 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 822 bytes | 
| コンパイル時間 | 2,418 ms | 
| コンパイル使用メモリ | 192,536 KB | 
| 実行使用メモリ | 25,972 KB | 
| 平均クエリ数 | 2.68 | 
| 最終ジャッジ日時 | 2025-02-02 14:46:51 | 
| 合計ジャッジ時間 | 6,601 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 15 WA * 6 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
void fast_io() {
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
}
int main() {
	fast_io();
	int h, w;
	cin >> h >> w;
	if (h == 1 && w == 1) {
		cout << "1 1" << endl;
		return 0;
	}
	if (h == 1 || w == 1) {
		cout << "? 1 1" << endl;
		int d;
		cin >> d;
		if (h == 1) {
			cout << "! 1 " << d - 1 << endl;
		} else {
			cout << "! " << d - 1 << " 1" << endl;
		}
		return 0;
	}
	cout << "? 1 1" << endl;
	int d1;
	cin >> d1;
	cout << "? 1 " << w << endl;
	int d2;
	cin >> d2;
	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
			int d1_true = (i - 1) * (i - 1) + (j - 1) * (j - 1);
			int d2_true = (i - 1) * (i - 1) + (w - j) * (w - j);
			if (d1_true == d1 && d2_true == d2) {
				cout << "! " << i << " " << j << endl;
				return 0;
			}
		}
	}
}
            
            
            
        