QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#223954 | #5471. Interactive Number Guessing | sofija6 | WA | 0ms | 3592kb | C++14 | 659b | 2023-10-22 22:29:33 | 2023-10-22 22:29:35 |
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-sum==mid)
{
p=mid;
l=mid+1;
}
else
r=mid-1;
}
ans+=(10-p-1)*cur;
cur*=10;
}
cout << "answer " << ans << "\n";
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3512kb
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:
ok correct
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3592kb
input:
89 85 91 92 93 85 91 83 94 87 95 94 96 97 89 94 87 86 94 96 79 85 82 81 94 87 86 94 96 97 89 85 91 92 84 94 87 86 85 91 92 84 85 91 83 85 82 90 94 96 97 89 94 69 95 76 73 72 85 82 81
output:
query 0 query 5 query 2 query 3 query 4 query 50 query 20 query 30 query 500 query 700 query 600 query 5000 query 7000 query 8000 query 9000 query 50000 query 70000 query 60000 query 500000 query 700000 query 800000 query 5000000 query 2000000 query 1000000 query 50000000 query 70000000 query 600000...
result:
wrong answer wrong guess: 3187646140241375 actual: 993187646149241375