結果

問題 No.2962 Sum Bomb Bomber
ユーザー 👑 AngrySadEightAngrySadEight
提出日時 2024-11-16 15:57:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 4,622 bytes
コンパイル時間 5,052 ms
コンパイル使用メモリ 228,360 KB
実行使用メモリ 105,208 KB
平均クエリ数 7.71
最終ジャッジ日時 2024-11-16 16:01:18
合計ジャッジ時間 195,392 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
testcase_48 TLE -
testcase_49 TLE -
testcase_50 TLE -
testcase_51 TLE -
testcase_52 AC 88 ms
25,452 KB
testcase_53 AC 75 ms
25,196 KB
testcase_54 TLE -
testcase_55 TLE -
testcase_56 TLE -
testcase_57 TLE -
testcase_58 TLE -
testcase_59 TLE -
testcase_60 TLE -
testcase_61 TLE -
testcase_62 TLE -
testcase_63 TLE -
testcase_64 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm>
#include <atcoder/all>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n) - 1; i >= 0; i--)
#define repk(i, k, n) for (int i = k; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define mod1 1000000007
#define mod2 998244353
#define mod3 100000007
#define vi vector<int>
#define vs vector<string>
#define vc vector<char>
#define vl vector<ll>
#define vb vector<bool>
#define vvi vector<vector<int>>
#define vvc vector<vector<char>>
#define vvl vector<vector<ll>>
#define vvb vector<vector<bool>>
#define vvvi vector<vector<vector<int>>>
#define vvvl vector<vector<vector<ll>>>
#define pii pair<int, int>
#define pil pair<int, ll>
#define pli pair<ll, int>
#define pll pair<ll, ll>
#define vpii vector<pair<int, int>>
#define vpll vector<pair<ll, ll>>
#define vvpii vector<vector<pair<int, int>>>
#define vvpll vector<vector<pair<ll, ll>>>

template <typename T>
void debug(T e) {
    cerr << e << endl;
}

template <typename T>
void debug(vector<T> &v) {
    rep(i, v.size()) { cerr << v[i] << " "; }
    cerr << endl;
}

template <typename T>
void debug(vector<vector<T>> &v) {
    rep(i, v.size()) {
        rep(j, v[i].size()) { cerr << v[i][j] << " "; }
        cerr << endl;
    }
}

template <typename T>
void debug(vector<pair<T, T>> &v) {
    rep(i, v.size()) { cerr << v[i].first << " " << v[i].second << endl; }
}

template <typename T>
void debug(set<T> &st) {
    for (auto itr = st.begin(); itr != st.end(); itr++) {
        cerr << *itr << " ";
    }
    cerr << endl;
}

template <typename T>
void debug(multiset<T> &ms) {
    for (auto itr = ms.begin(); itr != ms.end(); itr++) {
        cerr << *itr << " ";
    }
    cerr << endl;
}

template <typename T>
void debug(map<T, T> &mp) {
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
        cerr << itr->first << " " << itr->second << endl;
    }
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << H << " ";
    debug_out(T...);
}

int main() {
    ll N;
    cin >> N;

    ll INF = 100000002;

    ll xl = -INF;
    ll xr = INF;

    map<ll, ll> xval;

    while (xr - xl > 1) {
        ll mid1 = (xl * 2 + xr) / 3;
        ll mid2 = (xl + xr * 2) / 3;

        if (xval.find(mid1) == xval.end()) {
            cout << "1 0 " << mid1 << endl;
            ll d;
            cin >> d;
            xval[mid1] = d;
        }
        if (xval.find(mid2) == xval.end()) {
            cout << "1 0 " << mid2 << endl;
            ll d;
            cin >> d;
            xval[mid2] = d;
        }
        if (xval[mid1] <= xval[mid2]) {
            xr = mid2;
        } else {
            xl = mid1;
        }
    }
    ll x;
    if (xval.find(xl) == xval.end()) {
        cout << "1 0 " << xl << endl;
        ll d;
        cin >> d;
        xval[xl] = d;
    }
    if (xval.find(xr) == xval.end()) {
        cout << "1 0 " << xr << endl;
        ll d;
        cin >> d;
        xval[xr] = d;
    }
    if (xval[xl] <= xval[xr]) {
        x = xl;
    } else {
        x = xr;
    }

    ll yl = -INF;
    ll yr = INF;

    map<ll, ll> yval;

    while (yr - yl > 1) {
        ll mid1 = (yl * 2 + yr) / 3;
        ll mid2 = (yl + yr * 2) / 3;

        if (yval.find(mid1) == yval.end()) {
            cout << "1 0 " << mid1 << endl;
            ll d;
            cin >> d;
            yval[mid1] = d;
        }
        if (yval.find(mid2) == yval.end()) {
            cout << "1 0 " << mid2 << endl;
            ll d;
            cin >> d;
            yval[mid2] = d;
        }
        if (yval[mid1] <= yval[mid2]) {
            yr = mid2;
        } else {
            yl = mid1;
        }
    }
    ll y;
    if (yval.find(yl) == yval.end()) {
        cout << "1 0 " << yl << endl;
        ll d;
        cin >> d;
        yval[yl] = d;
    }
    if (yval.find(yr) == yval.end()) {
        cout << "1 0 " << yr << endl;
        ll d;
        cin >> d;
        yval[yr] = d;
    }
    if (yval[yl] <= xval[yr]) {
        y = yl;
    } else {
        y = yr;
    }
    cout << "2 " << x << " " << y << endl;
}
0