Test instructions
The interaction problem should have been carried out on the plane.
In fact, a straight line can be, in fact, to be more complex on the plane.
Solution
Assuming that the \ (l\) dot is a black point, \ (r\) is the white dot, then place the next point at \ (l + r/2\) , then recursively.
Code
#include <ctype.h> #include <stdio.h> #include <string> #include <iostream> #include < algorithm>using namespace Std;const int N = 39;struct Node {int color, position; BOOL operator < (const Node &x) Const {return color = = X.color? position < X.position:color < x.co Lor }} p[n];const int XXX = 4323;bool Check (int position, int now) {string S; P[now].position = position; printf ("%d%d\n", XXX, position); Fflush (stdout); Cin >> S; if (s = = "White") return p[now].color = 0; else return p[now].color = 1;} int main () {int n; scanf ("%d", &n); int L = 1, R = 1e9, mid; for (int i = 1; I <= n; i + = 1) {mid = L + R >> 1; if (Check (Mid, i)) R = Mid; else L = mid; } int res = 0; for (int i = 1; i < n; i + = 1) std:: Swap (P[i], p[i + 1]); Std::sort (p + 1, p + 1 + N); for (int i = 2; I <= n; i + = 1) if (p[i].color! = P[i-1].color) { res = p[i-1].position + 1; Break } if (res) printf ("%d%d%d%d\n", XXX-1, Res-1, XXX + 1, res), fflush (stdout); else printf ("%d%d%d\n", XXX-1, Res, XXX + 1, res), fflush (stdout); return 0;}
CF1064 e-dwarves, Hats and extrasensory abilities