結果
問題 |
No.3018 目隠し宝探し
|
ユーザー |
![]() |
提出日時 | 2025-01-25 13:51:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,018 bytes |
コンパイル時間 | 1,687 ms |
コンパイル使用メモリ | 161,372 KB |
実行使用メモリ | 25,972 KB |
平均クエリ数 | 2.82 |
最終ジャッジ日時 | 2025-01-25 23:00:35 |
合計ジャッジ時間 | 5,047 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 20 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<long long> VL; typedef vector<VL> VVL; typedef long long LL; #define all(a) (a).begin(), (a).end() #define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl #define ALL(a) (a).begin(),(a).end() #define pb push_back int main() { int h,w,d,dd;cin>>h>>w; if(h==1){ cout<<"? "<<1<<' '<<1<<endl; cin>>d; for(int j=1;j<=w;j++){ if(d==(j-1)*(j-1)){ cout<<"! "<<1<<' '<<j<<endl;return 0; } } } if(w==1){ cout<<"? "<<1<<' '<<1<<endl; cin>>d; for(int j=1;j<=h;j++){ if(d==(j-1)*(j-1)){ cout<<"! "<<j<<' '<<1<<endl;return 0; } } } cout<<"? "<<1<<' '<<1<<endl; cin>>d; cout<<"? "<<1<<' '<<w<<endl; cin>>dd; for(int i=1;i<=h;i++)for(int j=1;j<=w;j++){ if((i-1)*(i-1)+(j-1)*(j-1)==d&&(i-1)*(i-1)+(j-w)*(j-w)==dd){ cout<<"! "<<i<<' '<<j<<endl; return 0; } } }