結果
| 問題 | No.2962 Sum Bomb Bomber |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-20 03:13:33 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 134 ms / 2,000 ms |
| + 0µs | |
| コード長 | 1,041 bytes |
| 記録 | |
| コンパイル時間 | 1,665 ms |
| コンパイル使用メモリ | 174,056 KB |
| 実行使用メモリ | 6,528 KB |
| 平均クエリ数 | 209.29 |
| 最終ジャッジ日時 | 2026-09-20 03:13:43 |
| 合計ジャッジ時間 | 8,272 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 64 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
ll query(ll x, ll y){
cout << 1 << ' ' << x << ' ' << y << endl;
ll ans; cin >> ans;
return ans;
}
ll fy(){
ll left=-1e9, right=1e9, nx=-1e9;
while(right-left>4){
ll ml=(2*left+right)/3;
ll mr=(left+2*right)/3;
ll sl=query(nx, ml);
ll sr=query(nx, mr);
if(sl<=sr) right=mr;
else left=ml;
}
ll sy=query(nx, left), ny=left;
for(ll y=left+1; y<=right; y++){
ll ns=query(nx, y);
if(sy>ns) sy=ns, ny=y;
}
return ny;
}
ll fx(ll y){
ll left=-1e9, right=1e9;
while(right-left>4){
ll ml=(2*left+right)/3;
ll mr=(left+2*right)/3;
ll sl=query(ml, y);
ll sr=query(mr, y);
if(sl<=sr) right=mr;
else left=ml;
}
ll sx=query(left, y), nx=left;
for(ll x=left+1; x<=right; x++){
ll ns=query(x, y);
if(sx>ns) sx=ns, nx=x;
}
return nx;
}
int main(void){
int n; cin >> n;
ll ny=fy(), nx=fx(ny);
cout << 2 << ' ' << nx << ' ' << ny << endl;
return 0;
}