結果

問題 No.513 宝探し2
ユーザー parukiparuki
提出日時 2017-05-05 22:39:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 962 bytes
コンパイル時間 1,863 ms
コンパイル使用メモリ 164,180 KB
実行使用メモリ 24,588 KB
平均クエリ数 28.58
最終ジャッジ日時 2023-09-23 13:21:40
合計ジャッジ時間 5,169 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 24 ms
23,328 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 24 ms
23,916 KB
testcase_09 AC 24 ms
23,556 KB
testcase_10 RE -
testcase_11 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define mt make_tuple
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;

int ask(int x, int y) {
    cout << x << ' ' << y << endl;
    int res;
    cin >> res;
    if (res == 0)exit(0);
    return res;
}

int main(){
    int x = 0, y = 0;
    for (int i = 16; i >= 0; --i) {
        int a = ask(x, y);
        if (a & 1 << i)x |= 1 << i;
    }
    for (int i = 16; i >= 0; --i) {
        int a = ask(x, y);
        if (a & 1 << i)y |= 1 << i;
    }
    ask(x, y);
    assert(0);
}
0