QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#224603 | #5471. Interactive Number Guessing | acagubica | WA | 1ms | 3640kb | C++14 | 511b | 2023-10-23 05:14:22 | 2023-10-23 05:14:23 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
long long res=0;
int query(long long a){
cout<<"query "<<a<<"\n";
int sum;
cin>>sum;
return sum;
}
void answer(long long a){
cout<<"answer "<<a<<"\n";
}
int main(){
int sum0=query(0);
for(long long i=1; i<=(long long)1e18; i*=10){
int l=1;
int d=9;
while(l<=d){
int s=(l+d)/2;
int sum=query(i*s);
if(sum<sum0+s)d=s-1;
else l=s+1;
}
res+=i*(10-l);
}
answer(res);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3640kb
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