QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#305829#5471. Interactive Number Guessingbasoo0TL 0ms0kbC++20484b2024-01-16 02:29:362024-01-16 02:29:36

Judging History

你现在查看的是最新测评结果

  • [2024-01-16 02:29:36]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-01-16 02:29:36]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    // cout<<"query 0"; fflush(stdout);
    // long long x; cin>>x;
    long long l=0,r=1000000000000000000;
    // while(l<r){
        long long mid=l+(l+r)/2;
        cout<<"query "<<mid; fflush(stdout);
        long long x; cin>>x;
        if(x<(mid%9)+1)r=mid;
        else l=mid+1;
    // }
    cout<<"answer "<<l; fflush(stdout);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:


output:


result: