QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#511444#5206. Hot and ColdzhangbojuWA 1ms3812kbC++17890b2024-08-09 21:47:012024-08-09 21:47:03

Judging History

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

  • [2024-08-09 21:47:03]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3812kb
  • [2024-08-09 21:47:01]
  • 提交

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);
}

Details

Tip: Click on the bar to expand more detailed information

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