Submission #890331

# Submission time Handle Problem Language Result Execution time Memory
890331 2023-12-21T03:36:04 Z UmairAhmadMirza Aliens (IOI07_aliens) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
unsigned main(){
	int n,x0,y0;
	cin>>n>>x0>>y0;
	//step1 is find M and center (to save query)
	//find center x take at most 101 query
	int bx=x0-1,ux=x0+1;
	string rep;
	while(bx>0){
		cout<<"examine "<<bx<<' '<<y0<<endl;
		cin>>rep;
		if(rep=="false")
			break;
		else
			bx--;
	}
	while(ux<=n){
		cout<<"examine "<<ux<<' '<<y0<<endl;
		cin>>rep;
		if(rep=="false")
			break;
		else
			ux++;
	}
	//find center y take at most 101 query
	int by=y0-1,uy=y0+1;
	while(by>0){
		cout<<"examine "<<x0<<' '<<by<<endl;
		cin>>rep;
		if(rep=="false")
			break;
		else
			by--;
	}
	while(uy<=n){
		cout<<"examine "<<x0<<' '<<uy<<endl;
		cin>>rep;
		if(rep=="false")
			break;
		else
			uy++;
	}
	int cx=(bx+ux)/2;
	int cy=(by+uy)/2;
	int m=(ux-bx)-1;
	//successfully found center of the current block and M as well
	//find coordinates of its current block
	int curx=cx-(2*m),cury=cy-(2*m);
	int xcor=0,ycor=0;
	while(curx>0){
		cout<<"examine "<<curx<<' '<<cy<<endl;
		cin>>rep;
		if(rep=="false")
			break;
		else{
			curx-=2*m;
			xcor--;
		}
	}
	while(cury>0){
		cout<<"examine "<<cx<<' '<<cury<<endl;
		cin>>rep;
		if(rep=="false")
			break;
		else{
			cury-=2*m;
			ycor--;
		}
	}
	//above 
	curx=cx+(2*m);
	cury=cy+(2*m);
	while(curx<=n){
		cout<<"examine "<<curx<<' '<<cy<<endl;
		cin>>rep;
		if(rep=="false")
			break;
		else{
			curx+=2*m;
			xcor++;
		}
	}
	while(cury<=n){
		cout<<"examine "<<cx<<' '<<cury<<endl;
		cin>>rep;
		if(rep=="false")
			break;
		else{
			cury+=2*m;
			ycor++;
		}
	}
	cx+=(m*xcor);
	cy+=(m*ycor);
	cout<<"solution "<<cx<<' '<<cy<<endl;
	return 0;
}

Compilation message

cc1plus: error: '::main' must return 'int'