結果

問題 No.513 宝探し2
ユーザー yomo3yomo3
提出日時 2020-04-08 00:07:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 1,293 ms
コンパイル使用メモリ 162,684 KB
実行使用メモリ 24,336 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 02:33:55
合計ジャッジ時間 2,424 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,652 KB
testcase_01 AC 21 ms
23,652 KB
testcase_02 AC 20 ms
23,640 KB
testcase_03 AC 20 ms
24,300 KB
testcase_04 AC 20 ms
24,336 KB
testcase_05 AC 23 ms
24,012 KB
testcase_06 AC 20 ms
23,520 KB
testcase_07 AC 21 ms
23,628 KB
testcase_08 AC 20 ms
23,376 KB
testcase_09 AC 22 ms
24,000 KB
testcase_10 AC 20 ms
23,640 KB
testcase_11 AC 20 ms
23,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int query(int x, int y) {
    cout << x << " " << y << endl;
    int d;
    cin >> d;
    return d;
}

int main() {
    int lim = 100000;
    int d1 = query(0, 0);
    int d2 = query(100000, 0);

    int ax = (d1 + lim - d2) / 2;
    int ay = (d1 + d2 - lim) / 2;

    cout << ax << " " << ay << endl;
}
0