# Codeforces Round #516 (Div. 1, by Moscow Team Olympiad) C

Source: Internet
Author: User

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

Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.