QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#331675#5206. Hot and ColdKevin5307#WA 1ms3824kbC++232.0kb2024-02-18 17:00:172024-02-18 17:00:18

Judging History

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

  • [2024-02-18 17:00:18]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3824kb
  • [2024-02-18 17:00:17]
  • 提交

answer

//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
bool firstTime;
string Closer,Further,Same;
int lstx;
int lsty;
string go(int x,int y)
{
	lstx=x;
	lsty=y;
	if(!firstTime)
	{
		firstTime=1;
		cout<<x<<" "<<y<<endl;
		string s;
		getline(cin,s);
		if(s.back()=='!') exit(0);
		return s;
	}
	cout<<x<<" "<<y<<endl;
	string s;
	getline(cin,s);
	if(s.back()=='!') exit(0);
	if(s==Closer) return "Closer_";
	if(s==Further) return "Further_";
	if(s==Same) return "Same_";
	if(sz(Closer)&&sz(Further)) return "Same_";
	if(sz(Further)&&sz(Same)) return "Closer_";
	if(sz(Same)&&sz(Closer)) return "Further_";
	return s;
}
const int M=1000000;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	go(0,0);
	string A=go(0,1);
	string wow=go(0,0);
	string B=go(1,0);
	int lx=0,rx=M;
	int ly=0,ry=M;
	if(A==B)
	{
		Closer=A;
		Further=wow;
	}
	else
	{
		go(M,0);
		Closer=go(M-1,0);
		if(A==Closer)
		{
			rx=0;
			Further=B;
		}
		else
		{
			ry=0;
			Further=A;
		}
	}
	while(lx<rx||ly<ry)
	{
		int midx=(lx+rx)/2;
		int midy=(ly+ry)/2;
		go(midx,midy);
		if(ly!=ry)
		{
			string state=go(lstx,lsty+1);
			if(state=="Further_")
				ry=midy;
			else
				ly=midy+1;
		}
		if(lx!=rx)
		{
			string state=go(lstx+1,lsty);
			if(state=="Further_")
				rx=midx;
			else
				lx=midx+1;
		}
	}
	go(lx,ly);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

0 0
0 1
0 0
1 0
500000 500000
500000 500001
500001 500001
250000 250000
250000 250001
250001 250001
125000 125000
125000 125001
125001 125001
62500 62500
62500 62501
62501 62501
31250 31250
31250 31251
31251 31251
15625 15625
15625 15626
15626 15626
7812 7812
7812 7813
7813 7813
3906 3906
3906 3907
...

result:

ok 63 points

Test #2:

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

input:

rr
qq
ww
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
qq
ww
ww
qq
qq
You are lucky today!

output:

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

result:

ok 58 points

Test #3:

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

input:

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

output:

0 0
0 1
0 0
1 0
500000 500000
500000 500001
500001 500001
250000 250000
250000 250001
250001 250001
125000 125000
125000 125001
125001 125001
62500 62500
62500 62501
62501 62501
31250 31250
31250 31251
31251 31251
15625 15625
15625 15626
15626 15626
7812 7812
7812 7813
7813 7813
3906 3906
3906 3907
...

result:

wrong answer Used 64 points but did not win