結果

問題 No.513 宝探し2
ユーザー rapurasurapurasu
提出日時 2017-05-05 22:59:49
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 886 bytes
コンパイル時間 1,618 ms
コンパイル使用メモリ 144,032 KB
実行使用メモリ 24,432 KB
平均クエリ数 20.25
最終ジャッジ日時 2023-09-23 13:29:08
合計ジャッジ時間 3,852 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,676 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 26 ms
24,408 KB
testcase_04 WA -
testcase_05 AC 26 ms
24,372 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 26 ms
23,436 KB
testcase_09 AC 26 ms
23,868 KB
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=8*4096;
    //LL now=32;
    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=8*4096;
    cout<<a<<" "<<x<<endl;
    //now=32;
    /*
    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