結果

問題 No.513 宝探し2
ユーザー rapurasurapurasu
提出日時 2017-05-05 22:48:44
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 809 bytes
コンパイル時間 1,769 ms
コンパイル使用メモリ 143,832 KB
実行使用メモリ 24,300 KB
平均クエリ数 36.25
最終ジャッジ日時 2023-09-23 13:25:27
合計ジャッジ時間 3,943 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
24,132 KB
testcase_01 AC 25 ms
24,300 KB
testcase_02 AC 25 ms
24,276 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 24 ms
23,904 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int main(){
    cout<<0<<" "<<0<<endl;
    LL a;
    cin>>a;
    if(a==0){
       return 0;
    }
    LL x=0;
    LL now=100002;
    REP(i,20){
        now/=2;
        cout<<0<<" "<<x+now<<endl;
        LL b;
        cin>>b;
        if(b==0)return 0;
        if(a>=b+now){
           a=b;
           x=x+now;
        }
    }
    LL y=0;
    now=100002;
    REP(i,20){
        now/=2;
        cout<<y+now<<" "<<x<<endl;
        LL b;
        cin>>b;
        if(b==0)return 0;
        if(a>=b+now){
           a=b;
           y=y+now;
        }
    }
	return(0);
}
0