QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#224605#5471. Interactive Number GuessingacagubicaWA 1ms3660kbC++14527b2023-10-23 05:16:162023-10-23 05:16:16

Judging History

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

  • [2023-10-23 05:16:16]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3660kb
  • [2023-10-23 05:16:16]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
long long res=0;
int query(long long a){
  cout<<"query "<<a<<"\n";
  int sum;
  cin>>sum;
  return sum;
}
void answer(long long a){
  cout<<"answer "<<a<<"\n";
  cout<<flush;
}
int main(){
  int sum0=query(0);
  for(long long i=1; i<=(long long)1e18; i*=10){
    int l=1;
    int d=9;
    while(l<=d){
      int s=(l+d)/2;
      int sum=query(i*s);
      if(sum<sum0+s)d=s-1;
      else l=s+1;
    }
    res+=i*(10-l);
  }
  answer(res);
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

query 0
query 5
query 7
query 6
query 50
query 70
query 80
query 500
query 700
query 800
query 900
query 5000
query 7000
query 8000
query 9000
query 50000
query 70000
query 80000
query 90000
query 500000
query 700000
query 800000
query 900000
query 5000000
query 7000000
query 8000000
query 9000000
q...

result:

wrong answer invalid range in query_count=71: 5000000000000000000