結果

問題 No.514 宝探し3
ユーザー latte0119latte0119
提出日時 2017-05-05 22:36:09
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 1,005 bytes
コンパイル時間 1,967 ms
コンパイル使用メモリ 144,260 KB
実行使用メモリ 24,348 KB
平均クエリ数 4.33
最終ジャッジ日時 2023-09-23 13:19:38
合計ジャッジ時間 2,345 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
23,760 KB
testcase_01 AC 21 ms
23,760 KB
testcase_02 AC 20 ms
23,988 KB
testcase_03 AC 20 ms
23,340 KB
testcase_04 AC 21 ms
24,300 KB
testcase_05 AC 21 ms
23,484 KB
testcase_06 AC 20 ms
23,640 KB
testcase_07 AC 21 ms
24,144 KB
testcase_08 AC 20 ms
23,640 KB
testcase_09 AC 21 ms
24,348 KB
testcase_10 AC 21 ms
23,640 KB
testcase_11 AC 22 ms
23,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    int x,y;
    int d1,d2;
    cout<<0<<" "<<0<<endl;
    cin>>d1;
    if(d1==0)return 0;

    cout<<0<<" "<<1000000000<<endl;
    cin>>d2;
    if(d2==0)return 0;

    int a=0,b=1000000000;
    if(d1<d2)b-=d2-d1;
    else a+=d1-d2;

    y=(a+b)/2;

    cout<<0<<" "<<0<<endl;
    cin>>d1;
    if(d1==0)return 0;

    cout<<1000000000<<" "<<0<<endl;
    cin>>d2;
    if(d2==0)return 0;

    a=0,b=1000000000;
    if(d1<d2)b-=d2-d1;
    else a+=d1-d2;
    x=(a+b)/2;
    cout<<x<<" "<<y<<endl;

    int latte;
    cin>>latte;
    assert(latte==0);
    return 0;
}
0