QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#438287#5471. Interactive Number Guessinggrass8cow#WA 1ms3876kbC++17478b2024-06-10 15:03:022024-06-10 15:03:03

Judging History

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

  • [2024-06-10 15:03:03]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3876kb
  • [2024-06-10 15:03:02]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll Ask(ll x){
    printf("query %lld\n",x);fflush(stdout);
    scanf("%lld",&x);return x;
}
int main(){
    ll t0=Ask(0);
    ll x=0,z=1;
    for(int i=0;i<18;i++,z*=10){
        int l=1,r=9,p=0;
        while(l<=r){
            int mi=(l+r)>>1;
            if(Ask(z*mi)==t0+mi)p=mi,l=mi+1;
            else r=mi-1;
        }
        x+=z*(9-p);
    }
    printf("%lld\n",x);
    return 0;
}

详细

Test #1:

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

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 type: 123