結果

問題 No.514 宝探し3
ユーザー sugarrrsugarrr
提出日時 2018-07-23 13:01:00
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 972 bytes
コンパイル時間 618 ms
コンパイル使用メモリ 80,656 KB
実行使用メモリ 24,216 KB
平均クエリ数 2.75
最終ジャッジ日時 2023-09-23 16:11:22
合計ジャッジ時間 1,837 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,664 KB
testcase_01 AC 23 ms
24,048 KB
testcase_02 AC 24 ms
24,036 KB
testcase_03 AC 23 ms
23,580 KB
testcase_04 AC 23 ms
23,796 KB
testcase_05 AC 24 ms
23,568 KB
testcase_06 AC 23 ms
23,784 KB
testcase_07 AC 23 ms
24,204 KB
testcase_08 AC 25 ms
23,664 KB
testcase_09 AC 24 ms
24,060 KB
testcase_10 AC 24 ms
24,216 KB
testcase_11 AC 24 ms
23,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>
#include<map>
#include<bitset>

using namespace std;
typedef long long ll;
#define i_7 1000000007
#define i_5 1000000005

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
ll inf=1000000000000;/*10^12*/
#define rep(i,l,r) for(ll i=l;i<=r;i++)
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}


//////////////////////////////////////

int print(int x,int y){
    cout<<x<<" "<<y<<endl;
    fflush(stdout);
    int b;cin>>b;
    return b;
}

int main(){
    int c=1000000000;
    int a=print(0,0);
    if(a==0)return 0;
    int b=print(c,0);
    if(b==0)return 0;
    int x,y;
    x=(a-b+c)/2;
    y=(a+b-c)/2;
    print(x,y);
    
    return 0;
}



0