Submission #858817

# Submission time Handle Problem Language Result Execution time Memory
858817 2023-10-09T08:31:50 Z maks007 Colors (BOI20_colors) C++14
0 / 100
1 ms 596 KB
#include "bits/stdc++.h"

using namespace std;

signed main () {
	int n;
	cin >> n;
	cout << "? 2" << endl;
	int x;
	cin >> x;
	int r = n + 1;
	for(int l = 2, f = 1;; f = 1 - f) {
		if(l + 2 >= r) break;
		if(f) {
			r -= 2;
			cout << "? " << r << endl;
			cin >> x;
			if(x == 0) {
				cout << "? " << r - (r - l + 1) << endl;
				cin >> x;
				if(x == 1) {
					cout << "= " << (r - l + 1) << endl;
				}else {
					cout << "= " << (r - l + 1) + 1 << endl;
				}
				return 0;
			}
		}else {
			l += 2;
			cout << "? " << l << endl;
			cin >> x;
			if(x == 0) {
				cout << "? " << l + (r - l + 1) << endl;
				cin >> x;
				if(x == 1) {
					cout << "= " << (r - l + 1) << endl;
				}else {
					cout << "= " << (r - l + 1) + 1 << endl;
				}
				return 0;
			}
		}
	}
	cout <<"= 1" << endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (4 queries)
2 Correct 0 ms 344 KB OK (4 queries)
3 Correct 1 ms 344 KB OK (6 queries)
4 Correct 0 ms 344 KB OK (13 queries)
5 Correct 0 ms 344 KB OK (8 queries)
6 Correct 0 ms 344 KB OK (14 queries)
7 Correct 0 ms 344 KB OK (10 queries)
8 Correct 0 ms 344 KB OK (5 queries)
9 Correct 0 ms 344 KB OK (6 queries)
10 Correct 0 ms 344 KB OK (5 queries)
11 Correct 0 ms 344 KB OK (3 queries)
12 Correct 0 ms 596 KB OK (4 queries)
13 Correct 0 ms 344 KB OK (7 queries)
14 Correct 0 ms 344 KB OK (9 queries)
15 Correct 0 ms 344 KB OK (7 queries)
16 Correct 0 ms 344 KB OK (18 queries)
17 Incorrect 0 ms 344 KB Wrong guess
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (4 queries)
2 Correct 0 ms 344 KB OK (4 queries)
3 Correct 1 ms 344 KB OK (6 queries)
4 Correct 0 ms 344 KB OK (13 queries)
5 Correct 0 ms 344 KB OK (8 queries)
6 Correct 0 ms 344 KB OK (14 queries)
7 Correct 0 ms 344 KB OK (10 queries)
8 Correct 0 ms 344 KB OK (5 queries)
9 Correct 0 ms 344 KB OK (6 queries)
10 Correct 0 ms 344 KB OK (5 queries)
11 Correct 0 ms 344 KB OK (3 queries)
12 Correct 0 ms 596 KB OK (4 queries)
13 Correct 0 ms 344 KB OK (7 queries)
14 Correct 0 ms 344 KB OK (9 queries)
15 Correct 0 ms 344 KB OK (7 queries)
16 Correct 0 ms 344 KB OK (18 queries)
17 Incorrect 0 ms 344 KB Wrong guess
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (4 queries)
2 Correct 0 ms 344 KB OK (4 queries)
3 Correct 1 ms 344 KB OK (6 queries)
4 Correct 0 ms 344 KB OK (13 queries)
5 Correct 0 ms 344 KB OK (8 queries)
6 Correct 0 ms 344 KB OK (14 queries)
7 Correct 0 ms 344 KB OK (10 queries)
8 Correct 0 ms 344 KB OK (5 queries)
9 Correct 0 ms 344 KB OK (6 queries)
10 Correct 0 ms 344 KB OK (5 queries)
11 Correct 0 ms 344 KB OK (3 queries)
12 Correct 0 ms 596 KB OK (4 queries)
13 Correct 0 ms 344 KB OK (7 queries)
14 Correct 0 ms 344 KB OK (9 queries)
15 Correct 0 ms 344 KB OK (7 queries)
16 Correct 0 ms 344 KB OK (18 queries)
17 Incorrect 0 ms 344 KB Wrong guess
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (4 queries)
2 Correct 0 ms 344 KB OK (4 queries)
3 Correct 1 ms 344 KB OK (6 queries)
4 Correct 0 ms 344 KB OK (13 queries)
5 Correct 0 ms 344 KB OK (8 queries)
6 Correct 0 ms 344 KB OK (14 queries)
7 Correct 0 ms 344 KB OK (10 queries)
8 Correct 0 ms 344 KB OK (5 queries)
9 Correct 0 ms 344 KB OK (6 queries)
10 Correct 0 ms 344 KB OK (5 queries)
11 Correct 0 ms 344 KB OK (3 queries)
12 Correct 0 ms 596 KB OK (4 queries)
13 Correct 0 ms 344 KB OK (7 queries)
14 Correct 0 ms 344 KB OK (9 queries)
15 Correct 0 ms 344 KB OK (7 queries)
16 Correct 0 ms 344 KB OK (18 queries)
17 Incorrect 0 ms 344 KB Wrong guess
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (4 queries)
2 Correct 0 ms 344 KB OK (4 queries)
3 Correct 1 ms 344 KB OK (6 queries)
4 Correct 0 ms 344 KB OK (13 queries)
5 Correct 0 ms 344 KB OK (8 queries)
6 Correct 0 ms 344 KB OK (14 queries)
7 Correct 0 ms 344 KB OK (10 queries)
8 Correct 0 ms 344 KB OK (5 queries)
9 Correct 0 ms 344 KB OK (6 queries)
10 Correct 0 ms 344 KB OK (5 queries)
11 Correct 0 ms 344 KB OK (3 queries)
12 Correct 0 ms 596 KB OK (4 queries)
13 Correct 0 ms 344 KB OK (7 queries)
14 Correct 0 ms 344 KB OK (9 queries)
15 Correct 0 ms 344 KB OK (7 queries)
16 Correct 0 ms 344 KB OK (18 queries)
17 Incorrect 0 ms 344 KB Wrong guess
18 Halted 0 ms 0 KB -