QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#223940#5471. Interactive Number Guessingsofija6WA 1ms3596kbC++14646b2023-10-22 22:23:122023-10-22 22:23:12

Judging History

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

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

answer

#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    string q="query";
    ll a,cur=1,sum,ans=0;
    cout << q << " " << 0 << "\n";
    cin >> sum;
    for (ll i=1;i<19;i++)
    {
        ll l=1,r=9,mid,p=10;
        while (l<=r)
        {
            mid=(l+r)/2;
            cout << q << " " << mid*cur << "\n";
            cin >> a;
            if (a-sum==mid)
            {
                p=mid;
                l=mid+1;
            }
            else
                r=mid-1;
        }
        ans=(10-p-1)*cur;
        cur*=10;
    }
    cout << ans << "\n";
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 0