結果
| 問題 | No.3018 目隠し宝探し | 
| コンテスト | |
| ユーザー |  umezo | 
| 提出日時 | 2025-01-27 08:27:01 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,033 bytes | 
| コンパイル時間 | 3,430 ms | 
| コンパイル使用メモリ | 274,852 KB | 
| 実行使用メモリ | 26,356 KB | 
| 平均クエリ数 | 2.55 | 
| 最終ジャッジ日時 | 2025-01-27 08:27:08 | 
| 合計ジャッジ時間 | 6,732 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 17 WA * 4 | 
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include<bits/stdc++.h>
using namespace std;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int h,w;
  cin>>h>>w;
  if(h==1){
    cout<<"? 1 1"<<endl;
    int d1;
    cin>>d1;
    for(int j=1;j<=w;j++){
      if((j-1)*(j-1)==d1){
        cout<<"! "<<1<<" "<<j<<endl;
        return 0;
      }
    }
  }
  else if(w==1){
    cout<<"? 1 1"<<endl;
    int d1;
    cin>>d1;
    for(int i=1;i<=w;i++){
      if((i-1)*(i-1)==d1){
        cout<<"! "<<i<<" "<<1<<endl;
        return 0;
      }
    }
  }
  else{
    cout<<"? 1 1"<<endl;
    int d1;
    cin>>d1;
    cout<<"? 1 2"<<endl;
    int d2;
    cin>>d2;
    for(int i=1;i<=h;i++){
      for(int j=1;j<=w;j++){
        if((i-1)*(i-1)+(j-1)*(j-1)==d1 && (i-1)*(i-1)+(j-2)*(j-2)==d2){
          cout<<"! "<<i<<" "<<j<<endl;
          return 0;
        }
      }
    }
  }
  return 0;
}
            
            
            
        