結果
| 問題 |
No.3159 Just Answer 10 Integers!
|
| コンテスト | |
| ユーザー |
jastaway
|
| 提出日時 | 2025-05-04 16:18:19 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 996 bytes |
| コンパイル時間 | 2,629 ms |
| コンパイル使用メモリ | 281,088 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-05-23 18:30:41 |
| 合計ジャッジ時間 | 5,378 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
vector<int> Xs;
vector<pair<int, int>> ans;
const int MX = 1000000;
bool ask(int xl, int xr, int yl, int yr)
{
cout << "? " << xl << " " << xr << " " << yl << " " << yr << endl;
int ret;
cin >> ret;
assert(ret == 0 || ret == 1);
return ret == 1;
}
void findx(int l, int r)
{
if(l + 1 == r)
{
Xs.push_back(l);
return;
}
int m = (l + r)/2;
if(ask(l, m - 1, 0, MX)) findx(l, m);
if(ask(m, r - 1, 0, MX)) findx(m, r);
return;
}
void findy(int l, int r, int x)
{
if(l + 1 == r)
{
ans.emplace_back(x, l);
return;
}
int m = (l + r)/2;
if(ask(x, x, l, m - 1)) findy(l, m, x);
if(ask(x, x, m, r - 1)) findy(m, r, x);
}
int main()
{
findx(0, MX + 1);
for(int x : Xs)
{
findy(0, MX + 1, x);
}
int N = ans.size();
cout << "! " << N << endl;
for(auto [x, y] : ans)
{
cout << x << " " << y << endl;
}
}
jastaway