Submission #890422

# Submission time Handle Problem Language Result Execution time Memory
890422 2023-12-21T07:12:44 Z MuhammadSaram Aliens (IOI07_aliens) C++17
10 / 100
1 ms 404 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n,x,y;
	cin>>n>>x>>y;
	int st=y,en=n+1;
	while (st+1<en)
	{
		int mid=(st+en)/2;
		cout<<"examine "<<x<<' '<<mid<<endl;
		string s;
		cin>>s;
		if (s=="true")
			st=mid;
		else
			en=mid;
	}
	y=st;
	st=x,en=n+1;
	while (st+1<en)
	{
		int mid=(st+en)/2;
		cout<<"examine "<<mid<<' '<<y<<endl;
		string s;
		cin>>s;
		if (s=="true")
			st=mid;
		else
			en=mid;
	}
	x=st;
	st=1,en=y;
	while (st+1<en)
	{
		int mid=(st+en)/2;
		cout<<"examine "<<x<<' '<<mid<<endl;
		string s;
		cin>>s;
		if (s=="false")
			st=mid;
		else
			en=mid;
	}
	int m=y-st;
	m=m/(m&(-m));
	x-=m/2;
	y-=m/2;
	for (int i=1;i<=5;i++)
		for (int j=1;j<=5;j++)
		{
			if (i%2!=j%2)
				continue;
			bool b=true;
			// cout<<i<<' '<<j<<endl;
			for (int k=1;k<=5 and b;k++)
				if (k!=i)
				{
					int y1=y+(k-i)*m;
					if (y1<1 or y1>n)
						b=false;
					else
					{
						cout<<"examine "<<x<<' '<<y1<<endl;
						string s;
						cin>>s;
						cout.flush();
						if (s=="false" and i%2==k%2)
							b=false;
						else if(s=="true" and i%2!=k%2)
							b=false;
					}
				}
			for (int k=1;k<=5 and b;k++)
				if (k!=j)
				{
					int x1=x+(k-j)*m;
					if (x1<1 or x1>n)
						b=false;
					else
					{
						cout<<"examine "<<x1<<' '<<y<<endl;
						string s;
						cin>>s;
						cout.flush();
						if (s=="false" and i%2==k%2)
							b=false;
						else if(s=="true" and i%2!=k%2)
							b=false;
					}
				}
			if (b)
			{
				cout<<"solution "<<x+(3-j)*m<<' '<<y+(3-i)*m<<endl;
				return 0;
			}
		}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - token expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Unexpected end of file - token expected
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - token expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Unexpected end of file - token expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 404 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Unexpected end of file - token expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - token expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Unexpected end of file - token expected
2 Halted 0 ms 0 KB -