QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#223969#5471. Interactive Number GuessingivazivaWA 1ms3824kbC++14942b2023-10-22 22:38:422023-10-22 22:38:42

Judging History

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

  • [2023-10-22 22:38:42]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3824kb
  • [2023-10-22 22:38:42]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long stepen=1;
    long long br=0;
    vector<long long> vec;
    cout<<"query 0"<<endl;
    long long sum; cin>>sum;
    while (br<=18)
    {
        long long l=0;
        long long r=9;
        long long rez=-1;
        while (l<=r)
        {
            long long mid=(l+r)/2;
            cout<<"query "<<stepen*mid<<endl;
            long long pos; cin>>pos;
            if (pos<sum)
            {
                rez=mid;
                r=mid-1;
            }
            else l=mid+1;
        }
        if (rez==-1) vec.push_back(0);
        else vec.push_back(10-rez);
        stepen*=10;
        br++;
    }
    reverse(vec.begin(),vec.end());
    cout<<"answer ";
    bool da=false;
    for (long long i=0;i<vec.size();i++)
    {
        if (vec[i]==0 and da) cout<<0;
        else if (vec[i]!=0) cout<<vec[i];
    }
}

详细

Test #1:

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

input:

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

output:

query 0
query 4
query 7
query 5
query 6
query 40
query 70
query 80
query 400
query 700
query 800
query 900
query 4000
query 7000
query 8000
query 9000
query 40000
query 70000
query 80000
query 90000
query 400000
query 700000
query 800000
query 900000
query 4000000
query 7000000
query 8000000
query 9...

result:

wrong answer invalid range in query_count=72: 4000000000000000000