QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#496903#4575. Interactive Treasure HuntyglWA 1ms3880kbC++14783b2024-07-28 16:52:122024-07-28 16:52:12

Judging History

你现在查看的是最新测评结果

  • [2024-07-28 16:52:12]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3880kb
  • [2024-07-28 16:52:12]
  • 提交

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)