QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#306523#5471. Interactive Number Guessingbasoo0TL 0ms0kbC++20441b2024-01-16 20:31:272024-01-16 20:31:28

Judging History

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

  • [2024-01-16 20:31:28]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-01-16 20:31:27]
  • 提交

answer

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

详细

Test #1:

score: 0
Time Limit Exceeded

input:


output:


result: