結果

問題 No.514 宝探し3
コンテスト
ユーザー momoyuu
提出日時 2024-09-30 01:47:05
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 276 ms / 2,000 ms
+ 999µs
コード長 456 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,024 ms
コンパイル使用メモリ 168,784 KB
実行使用メモリ 9,760 KB
平均クエリ数 2.77
最終ジャッジ日時 2026-10-31 09:54:15
合計ジャッジ時間 3,082 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge7_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;

ll ask(ll x,ll y){
    cout<<x<<" "<<y<<endl;
    ll d;
    cin>>d;
    if(d==0) exit(0);
    return d;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    ll k = ask(0,0);
    ll kk = ask(1000000000ll,0);
    // x + y = k
    // 100000 - x + y = kk
    kk -= 1000000000ll;
    ll y = (k+kk) / 2;
    ll x = k - y;
    ask(x,y);
}

0