Submission #507944

# Submission time Handle Problem Language Result Execution time Memory
507944 2022-01-13T04:46:02 Z ac2hu Aliens (IOI07_aliens) C++14
0 / 100
5 ms 304 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long 
const int M = 31623;
const int N = 2'000'000'000;
bool check(int i,int j,int n){
	if(i >0 && j >0 && i <= n && j <= n){
		cout << "examine " << i << " " << j << endl;
		string s;cin >> s;
		return ((s == "true")? true : false);
	}
	return 0;
}
signed main(){
	iostream::sync_with_stdio(false);
	cin.tie(nullptr);cout.tie(nullptr);
	int n,x,y;cin >> n >> x >> y;
	int rx = x;
	for( ;rx<=n;rx++){
		if(!check(rx,y,n)){
			break;
		}
	}
	rx--;
	int ry = y;
	for(;ry<=n;ry++)
		if(!check(rx,ry,n))
			break;
	ry--;
	int l = 0,r = n - max(rx,ry);
	while(l < r){
		int mid = (l + r + 1)/2;
		if(check(rx + mid, ry + mid,n))
			l = mid;
		else 
			r = mid - 1;
	}
	pair<int,int> topcorner = {rx + l, ry + l};
	l = 0,r = min(rx,ry) - 1;
	while(l < r){
		int mid = (l + r + 1)/2;
		if(check(rx - mid,ry - mid, n))
			l = mid;
		else 
			r = mid - 1;
	}
	pair<int,int> bottomcorner = {rx - l,ry - l};
	pair<int,int> center = {(topcorner.first + bottomcorner.first)/2,(topcorner.second + bottomcorner.second)/2};
	cout << "solution " << center.first << " " << center.second << "\n";
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 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 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Runtime error 3 ms 304 KB Execution killed with signal 13
# 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 Runtime error 5 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -