QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#224103#5471. Interactive Number GuessingivazivaWA 1ms3664kbC++14815b2023-10-22 23:53:232023-10-22 23:53:24

Judging History

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

  • [2023-10-22 23:53:24]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3664kb
  • [2023-10-22 23:53:23]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout<<"query 0"<<endl;
    long long sum; cin>>sum;
    long long stepen=1;
    long long ans=0;
    for (long long i=0;i<=18;i++)
    {
        long long l=1;
        long long r=9;
        long long rez=-1;
        while (l<=r)
        {
            long long mid=(l+r)/2;
            cout<<"query "<<mid*stepen<<endl;
            long long pos; cin>>pos;
            if (pos==sum+mid) 
            {
                rez=mid;
                l=mid+1;
            }
            else r=mid-1;
        }
        if (rez!=-1) ans+=(10-rez-1)*stepen;
        stepen*=10;
    }
    cout<<"answer "<<ans<<endl;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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