結果

問題 No.513 宝探し2
ユーザー けーむけーむ
提出日時 2020-03-24 16:54:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,547 bytes
コンパイル時間 2,239 ms
コンパイル使用メモリ 162,580 KB
実行使用メモリ 36,240 KB
最終ジャッジ日時 2023-09-24 03:14:17
合計ジャッジ時間 8,391 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll x = 0, y = 0;
    ll xs = 10000;
    ll bx = 0, br, ax, ar;
    printf("%lld %lld\n", 0, 0);
    cin >> br;
    if (br == 0) {
        printf("%lld %lld\n", 0, 0);
        return 0;
    }
    while(true) {
        ax = bx + xs;
        printf("%lld %lld\n", ax, 0);
        cin >> ar;
        if (ar == 0) {
            printf("%lld %lld\n", ax, 0);
            return 0;
        }
        if (br <= ar) {
            if (xs == 1) break;
            xs /= 10;
        }
        else {
            bx = ax;
            br = ar;
        }
    }
    x = bx;
    ll ys = 10000;
    ll by = 0, ay;
    while(true) {
        ay = by + ys;
        printf("%lld %lld\n", x, ay);
        cin >> ar;
        if (ar == 0) {
            printf("%lld %lld\n", x, ay);
            return 0;
        }
        if (br <= ar) {
            if (ys == 1) break;
            ys /= 10;
        }
        else {
            by = ay;
            br = ar;
        }
    }
    printf("%lld %lld\n", x, y);
    return 0;
}
0