Submission #533169

# Submission time Handle Problem Language Result Execution time Memory
533169 2022-03-05T04:07:26 Z huangqr Aliens (IOI07_aliens) C++14
0 / 100
3 ms 200 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pl;
typedef pair<ll,pl> ppl;
const ll lim=2e5+5;

inline bool query(ll x,ll y){
	cout<<"examine "<<x<<" "<<y<<"\n";
	cout.flush();
	string s;
	cin>>s;
	return (s=="true");
}

int main(){
    ios_base::sync_with_stdio(0),cin.tie(NULL);
	ll n,x,y;
	cin>>n>>x>>y;
	int dx[4]={1,-1,0,0},dy[4]={0,0,1,-1};
	ll dist[4]={n-x,x-1,n-y,y-1},tsa[4];
	for(int i=0;i<4;i++){
		ll left = 0, right = dist[i], best = 0; //Binary search for the largest value that is red. Some modifications due to checkerboard 
		bool vroomed=0;
		while(left<=right){
			ll mid = (left+right)/2;
			if(query(x + mid * dx[i], y + mid * dy[i])){
				if(vroomed){
					best = max(best, mid);
					left = mid + 1;
				}
				else{
					vroomed = true;
					mid /= 2;
					while(mid){
						if(!query(x + mid * dx[i], y + mid * dy[i]))right = mid - 1;
						mid /= 2;
					}
				}
			}
			else{
				right = mid - 1;
			}
			if(i<2)tsa[i]=x+dx[i]*best;
			else tsa[i]=y+dy[i]*best;
		}
	}
	//cout<<"\n\n";
	//for(int i=0;i<4;i++)cout<<tsa[i]<<" ";
	assert(tsa[1]-tsa[0]==tsa[3]-tsa[2]);
	cout<<"solution 1 1\n";
	cout.flush();
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -