QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#306543#5471. Interactive Number GuessingereringWA 1ms3572kbC++20734b2024-01-16 21:13:492024-01-16 21:13:50

Judging History

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

  • [2024-01-16 21:13:50]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3572kb
  • [2024-01-16 21:13:49]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define ll long long
#define int ll
const long long inf=1e18;
const int MOD=1e9+7;
const int N=1e5+5;
signed main()
{
  // ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
   cout<<"query 0"<<endl;
   int sum; cin>>sum;
   string s="";
   int x=1;
   for(int i=1;i<=17;i++){
     int l=1,r=9;
     while(l<r){
       int mid=(l+r+1)/2;
       cout<<"query "<<(10-mid)*x<<endl;
       int newsum; cin>>newsum;
       if(newsum<sum)l=mid;
       else r=mid-1;
     }
     string k=to_string(l);
     s+=k;
     x*=10;
   }
   while(s.back()==0)s.pop_back();
   reverse(s.begin(),s.end());
   cout<<"answer "<<s;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3572kb

input:

6
11
4
12
11
13
5
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14
11
13
14

output:

query 0
query 5
query 7
query 6
query 50
query 70
query 80
query 500
query 700
query 800
query 5000
query 7000
query 8000
query 50000
query 70000
query 80000
query 500000
query 700000
query 800000
query 5000000
query 7000000
query 8000000
query 50000000
query 70000000
query 80000000
query 500000000
...

result:

wrong answer wrong guess: 11111111111111123  actual: 123