結果
問題 | No.2962 Sum Bomb Bomber |
ユーザー |
![]() |
提出日時 | 2024-11-16 15:39:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 121 ms / 2,000 ms |
コード長 | 821 bytes |
コンパイル時間 | 4,161 ms |
コンパイル使用メモリ | 251,812 KB |
最終ジャッジ日時 | 2025-02-25 04:24:06 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 64 |
ソースコード
#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 1000000001 #define Inf64 1000000000000000000LL long long query(long long x,long long y){ cout<<1<<' '<<x<<' '<<y<<endl; long long res;cin>>res; return res; } int main(){ int n;cin>>n; vector<long long> ans(2); rep(i,2){ long long ok = -1000000000,ng = 1000000000; while(ng-ok>1LL){ long long mid = (ok+ng)/2; long long A,B; { long long x = mid,y = 0; if(i)swap(x,y); A = query(x,y); } { long long x = mid+1,y = 0; if(i)swap(x,y); B = query(x,y); } if(A<B)ng = mid; else ok = mid; } ans[i] = ok+1; } cout<<2<<' '<<ans[0]<<' '<<ans[1]<<endl; return 0; }