QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#511444 | #5206. Hot and Cold | zhangboju | WA | 1ms | 3812kb | C++17 | 890b | 2024-08-09 21:47:01 | 2024-08-09 21:47:03 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int lim = 1e6;
string close;
string ask(int x, int y) {
if (x < 0) x = 0;
if (x > lim) x = lim;
if (y < 0) y = 0;
if (y > lim) y = lim;
cout << x << " " << y << endl;
string s;
getline(cin, s);
if (s.back() == '!') exit(0);
return s;
}
int main() {
ask(0, 0);
string s1 = ask(0, 0);
string s2 = ask(1, 1);
if (s1 == s2) {
for (int i : {0, 1, 2})
for (int j : {0, 1, 2})
ask(i, j);
return 0;
}
close = s1;
int xl = 0, xr = lim, yl = 0, yr = lim;
for (int t = 0; t < 20; t++) {
if (xl == xr && yl == yr)
break;
int xmid = (xl + xr) >> 1;
int ymid = (yl + yr) >> 1;
ask(xmid, ymid);
if (ask(xmid + 1, ymid) == close)
xl = xmid + 1;
else xr = xmid - 1;
if (ask(xmid + 1, ymid + 1) == close)
yl = ymid + 1;
else yr = ymid - 1;
}
ask(xl, yl);
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3812kb
input:
Tabilmadi Sama distanco Daha yakin Dalej Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Daha yakin Dalej Dalej Daha y...
output:
0 0 0 0 1 1 500000 500000 500001 500000 500001 500001 249999 249999 250000 249999 250000 250000 124999 124999 125000 124999 125000 125000 62499 62499 62500 62499 62500 62500 31249 31249 31250 31249 31250 31250 15624 15624 15625 15624 15625 15625 7811 7811 7812 7811 7812 7812 3905 3905 3906 3905 3906...
result:
wrong answer Used 64 points but did not win