QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#496925#4575. Interactive Treasure HuntyglWA 1ms3888kbC++14789b2024-07-28 16:59:562024-07-28 16:59:56

Judging History

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

  • [2024-07-28 16:59:56]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3888kb
  • [2024-07-28 16:59:56]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int ask(int x, int y ) {
	int d;
	printf("SCAN %d %d\n", x, y);
	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, sy / 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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3800kb

input:

1
2 3
3
5
3
1
1
1

output:

SCAN 1 1
SCAN 2 1
SCAN 1 1
SCAN 1 2
DIG 1 2
DIG 1 3

result:

ok (1 test case)

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3888kb

input:

72
3 3
1
3
1
1
1
1
3 3
4
4

output:

SCAN 1 1
SCAN 3 1
SCAN 1 1
SCAN 1 1
DIG 1 1
DIG 2 1
SCAN 1 1
SCAN 1 1
SCAN 0 1
SCAN 1 2

result:

wrong answer Integer 0 violates the range [1, 3] (test case 2)