結果
| 問題 |
No.3161 Find Presents
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2025-05-23 20:10:41 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,020 bytes |
| コンパイル時間 | 4,004 ms |
| コンパイル使用メモリ | 252,032 KB |
| 実行使用メモリ | 26,456 KB |
| 平均クエリ数 | 672.64 |
| 最終ジャッジ日時 | 2025-05-23 20:10:55 |
| 合計ジャッジ時間 | 11,522 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 80 |
ソースコード
#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000005
#define Inf64 4000000000000000001LL
vector<pair<int,int>> ans;
int query(int x1,int x2,int y1,int y2){
cout<<"? "<<x1<<' '<<x2<<' '<<y1<<' '<<y2<<endl;
int res;
cin>>res;
return res;
}
void dfs(int x1,int x2,int y1,int y2){
if(x1!=x2){
int m = (x1+x2)/2;
int res = query(x1,m,y1,y2);
if(res==0)dfs(m+1,x2,y1,y1);
else{
dfs(x1,m,y1,y2);
res = query(m+1,x2,y1,y2);
if(res)dfs(m+1,x2,y1,y2);
}
}
else if(y1!=y2){
int m = (y1+y2)/2;
int res = query(x1,x2,y1,m);
if(res==0)dfs(x1,x2,m+1,y2);
else{
dfs(x1,x2,y1,m);
res = query(x1,x2,m+1,y2);
if(res)dfs(x1,x2,m+1,y2);
}
}
else{
ans.emplace_back(x1,y1);
}
}
int main(){
dfs(0,1000000,0,1000000);
cout<<"! "<<ans.size()<<endl;
rep(i,ans.size()){
cout<<ans[i].first<<' '<<ans[i].second<<endl;
}
return 0;
}
沙耶花