QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#305831#5471. Interactive Number Guessingbasoo0TL 0ms0kbC++20546b2024-01-16 02:39:002024-01-16 02:39:01

Judging History

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

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

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 y=0;
    for(long long i=100000000000000000-1 ; i>=1 ; i/=10){
        cout<<"query "<<y+(i*9); fflush(stdout);
        long long x; cin>>x; x%=9;
        while(x==(y/i +1)%9){
            y+=i*9;
            cout<<"query "<<y+(i*9); fflush(stdout);
            cin>>x; x%=9;
        }
    }
    cout<<y<<endl;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:


output:

query 899999999999999991

result: