Problem chain Description
Interacting with the interaction library, you give the n points, the interaction library specifies the color, and a line splits the color.
Sol
Two points on the x-axis and the y-axis respectively.
Code
#include <bits/stdc++.h>#defineMid (l+r>>1)using namespacestd;intN,l,r;Charp1[102],p2[102],p3[102];voidWorkintXintPosintg) {L=500000000; R=1000000000; for(inti=x;i<n;i++) {printf ("%d%d\n", Pos,mid); Fflush (stdout); scanf ("%s", p3+1); if(p2[1]==p3[1]) L=mid;ElseR=Mid; } if(p1[1]==p2[1]) { if(p2[1]==p3[1]) printf ("%d %d%d%d\n", pos,mid+1, pos+1,500000000); Elseprintf"%d %d%d%d\n", pos,mid-1, pos+1,500000000); } Else { if(p2[1]==p3[1]) printf ("%d %d%d%d\n", pos,mid+1, pos-1,500000000); Elseprintf"%d %d%d%d\n", pos,mid-1, pos-1,500000000); } //if (p2[1]==p1[1]) {//printf ("%d%d%d\n", pos-(!g), mid+1,pos-(!g) +1,1000000000-mid-1);//} else {//printf ("%d%d%d\n", pos-(!g), mid-1,pos-(!g) +1,1000000000-mid+1);// }Exit0);} Signed Main () {scanf ("%d",&N); printf ("0 500000000\n"); fflush (stdout); scanf ("%s", p1+1); L=0; R=1000000000; for(intI=1; i<n;i++) { if(mid-l>=5&&r-mid>=5) {printf ("%d%d\n", Mid,500000000); Fflush (stdout); }ElseWork (i,mid,p1[1]==p2[1]); scanf ("%s", p2+1); if(p2[1]==p1[1]) L=mid;ElseR=Mid; } if(p2[1]==p1[1]) printf ("%d 40000000%d 600000000", mid,mid+1); Elseprintf"%d 40000000%d 600000000", mid-1, Mid); Fflush (stdout);}
Codeforces Round #516 (Div. 1, by Moscow Team Olympiad) C