QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#511446#5206. Hot and ColdzhangbojuWA 1ms3740kbC++17890b2024-08-09 21:49:492024-08-09 21:49:53

Judging History

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

  • [2024-08-09 21:49:53]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3740kb
  • [2024-08-09 21:49:49]
  • 提交

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 = s2;
	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: 100
Accepted
time: 1ms
memory: 3584kb

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
Daha yakin
D...

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:

ok 55 points

Test #2:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

rr
ee
qq
qq
qq
qq
qq
qq
qq
ww
ww
ww
qq
ww
ww
qq
ww
ww
ww
qq
qq
qq
qq
qq
qq
qq
qq
ww
ww
ww
qq
ww
ww
qq
ww
ww
ww
qq
qq
qq
qq
qq
qq
qq
qq
ww
ww
ww
qq
ww
ww
You are lucky today!

output:

0 0
0 0
1 1
500000 500000
500001 500000
500001 500001
750000 750000
750001 750000
750001 750001
875000 875000
875001 875000
875001 875001
812500 812500
812501 812500
812501 812501
781250 781250
781251 781250
781251 781251
765625 765625
765626 765625
765626 765626
773437 773437
773438 773437
773438 7...

result:

ok 52 points

Test #3:

score: 0
Accepted
time: 1ms
memory: 3532kb

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
Dalej
Daha yakin
Daha yakin
D...

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:

ok 55 points

Test #4:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

voyne net
net voyne
miru mir
miru mir
miru mir
mir miru
miru mir
mir miru
mir miru
miru mir
mir miru
miru mir
miru mir
miru mir
miru mir
miru mir
mir miru
miru mir
miru mir
mir miru
miru mir
miru mir
mir miru
mir miru
miru mir
mir miru
miru mir
mir miru
miru mir
mir miru
miru mir
miru mir
miru mir
m...

output:

0 0
0 0
1 1
500000 500000
500001 500000
500001 500001
750000 249999
750001 249999
750001 250000
625000 124999
625001 124999
625001 125000
562500 187499
562501 187499
562501 187500
593750 218749
593751 218749
593751 218750
578125 234374
578126 234374
578126 234375
570312 242186
570313 242186
570313 2...

result:

ok 59 points

Test #5:

score: -100
Wrong Answer
time: 1ms
memory: 3600kb

input:

miru    mir
miru   mir
miru  mir
miru  mir
miru mir
miru  mir
miru  mir
miru mir
miru mir
miru  mir
miru  mir
miru mir
miru  mir
miru  mir
miru  mir
miru  mir
miru  mir
miru mir
miru  mir
miru  mir
miru mir
miru  mir
miru mir
miru mir
miru  mir
miru  mir
miru mir
miru mir
miru mir
miru  mir
miru  mi...

output:

0 0
0 0
1 1
500000 500000
500001 500000
500001 500001
249999 750000
250000 750000
250000 750001
124999 625000
125000 625000
125000 625001
187499 562500
187500 562500
187500 562501
218749 593750
218750 593750
218750 593751
234374 578125
234375 578125
234375 578126
242186 570312
242187 570312
242187 5...

result:

wrong answer format  Unexpected end of file - int32 expected