QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#223942 | #5471. Interactive Number Guessing | StefanSebez | WA | 1ms | 3628kb | C++14 | 752b | 2023-10-22 22:24:44 | 2023-10-22 22:24:45 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
int Ask(int a)
{
cout<<"query "<<a<<endl;
int b;cin>>b;
return b;
}
signed main()
{
vector<int>res;
int x=Ask(0);
for(int j=0,e=1;j<=17;j++,e*=10)
{
int temp;
int l=1,r=9,mid=(l+r)/2;
while(l<=r)
{
int y=Ask(mid*e);
if(y==x+mid)
{
l=mid+1;
}
else
{
r=mid-1;
temp=10-mid;
}
mid=(l+r)/2;
}
res.pb(temp);
}
reverse(res.begin(),res.end());
for(auto i:res)cout<<i;
cout<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3628kb
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: 111111111111111123