Submission #1060493

# Submission time Handle Problem Language Result Execution time Memory
1060493 2024-08-15T16:10:02 Z Halym2007 Aliens (IOI07_aliens) C++17
0 / 100
3 ms 600 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sz size()
#define ff first
#define ss second
#define pb push_back
#define pii pair <int, int>
const int N = 2e5 + 5;


int aa[] = { 0, 2, 3, 1, 3, 0, 2, 4, 1, 3, 0, 2, 4 };
int bb[] = { 0, 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4 };

int n, sorag = 0;

bool ask (int jj, int kk) {
	if (jj > n or kk > n) return 0;
	if (jj < 1 or kk < 1) return 0;
	sorag++;
	assert (sorag <= 300);
	cout << "examine " << jj << " " << kk << endl;
	string s;
	cin >> s;
	if (s[0] == 't') return 1;
	return 0;
}

bool barla (int x, int y, int m) {
	if (ask (x, y) == 1 and ask(x + 5 * m - 1, y) == 1 and ask (x, y - 5 * m + 1) == 1 and ask (x + 5 * m - 1, y - 5 * m + 1) == 1) {
		return 1;
	}
	return 0;
}


int x, y;

int main () {
//	freopen ("input.txt", "r", stdin);
//	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);	
	int a, b;
	cin >> n >> a >> b;
	
	int m = 1;
	int l = a, r = a; 
	while (l > 1) {
		l--;
		if (!ask(l, b)) {
			l++;
			break;
		}
		m++;
	}
	while (r < n) {
		r++;
		if (!ask(r, b)) {
			r--;
			break;
		}
		m++;
	}
	
	int l1 = b, r1 = b;
	while (l1 > 1) {
		l1--;
		if (!ask(a, l1)) {
			l1++;
			break;
		}
	}
	while (r < n) {
		r1++;
		if (!ask(a, r1)) {
			r1--;
			break;
		}
	}
	
	x = l;y = r1;
//	cout << l << " " << r << " " << l1 << " " << r1 << "\n";
//	return 0;
//	return cout << x << " " << y << " " << m, 0;
	for (int j = 0; j < 13; ++j) {
		if (barla (x - m * aa[j], y + m * bb[j], m)) {
			return cout << "solution "<< (x - m * aa[j]) + 3 * m - 2 << " " << (y + m * bb[j]) - 3 * m + 2, 0;
		}
	}
	
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 344 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 388 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 344 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 432 KB Execution killed with signal 6
2 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 Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 344 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 432 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -