QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#223973 | #5471. Interactive Number Guessing | sofija6 | WA | 1ms | 3596kb | C++14 | 658b | 2023-10-22 22:40:02 | 2023-10-22 22:40:02 |
Judging History
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=9;
while (l<=r)
{
mid=(l+r)/2;
cout << q << " " << mid*cur << "\n";
cin >> a;
if (a+mid==sum)
{
p=mid;
l=mid+1;
}
else
r=mid-1;
}
ans+=(9-p)*cur;
cur*=10ll;
}
cout << "answer " << 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 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7 11 8 7
output:
query 0 query 5 query 2 query 1 query 50 query 20 query 10 query 500 query 200 query 100 query 5000 query 2000 query 1000 query 50000 query 20000 query 10000 query 500000 query 200000 query 100000 query 5000000 query 2000000 query 1000000 query 50000000 query 20000000 query 10000000 query 500000000 ...
result:
wrong answer wrong guess: 0 actual: 123