QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#223950 | #5471. Interactive Number Guessing | Habitus | WA | 1ms | 3356kb | C++14 | 694b | 2023-10-22 22:27:58 | 2023-10-22 22:27:59 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int zbir, zbir1;
ll x;
int main() {
cout << "query 0\n";
cout.flush();
cin >> zbir;
zbir1=zbir;
for(ll i=1, j=0; j<=18; i*=10, j++) {
if(zbir1==0) break;
int l=1, r=9;
while(l<=r) {
int mid=(l+r)/2;
cout << "query " << (ll)mid*i << "\n";
cout.flush();
int rez; cin >> rez;
if(rez<zbir) r=mid-1;
else l=mid+1;
}
x+=i*(9-r);
//cout << x << "\n"; cout.flush();
zbir1-=9-r;
}
cout << "answer " << x << "\n";
cout.flush();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3356kb
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