QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#438286#5471. Interactive Number Guessinggrass8cow#WA 1ms3816kbC++17477b2024-06-10 15:02:482024-06-10 15:02:48

Judging History

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

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

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<2;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: 3816kb

input:

6
11
4
12
11
13
5

output:

query 0
query 5
query 7
query 6
query 50
query 70
query 80
23

result:

wrong answer invalid type: 23