QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#496903 | #4575. Interactive Treasure Hunt | ygl | WA | 1ms | 3880kb | C++14 | 783b | 2024-07-28 16:52:12 | 2024-07-28 16:52:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int ask(int x, int y ) {
int d;
printf("SCAN %d %d\n");
cin >> d;
return d;
}
void solve() {
int n, m;
cin >> n >> m;
int d1 = ask(1, 1);
int d2 = ask(n, 1);
int sx = (d1 - d2 + 2 * n + 2) / 2;
int sy = (d1 + d2 + 6 - 2 * n) / 2;
int d3 = ask(sx / 2, 1);
int d4 = ask(1, sx / 2);
int nx = (sx - (d3 - sy + 2)) / 2;
int mx = (sx + d3 - sy + 2) / 2;
int ny = (sy - (d4 - sx + 2)) / 2;
int my = (sy + (d4 - sx + 2)) / 2;
printf("DIG %d %d\n", nx, ny);
int x;
cin >> x;
if (x) {
printf("DIG %d %d\n", mx, my);
}else {
printf("DIG %d %d\n", nx, my);
printf("DIG %d %d\n", mx, ny);
}
}
int main() {
int T;
cin >> T;
while(T -- ){
solve();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3880kb
input:
1 2 3
output:
SCAN -1434495232 -1434495232
result:
wrong answer Integer -1434495232 violates the range [1, 2] (test case 1)