E - Down or Right Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

Posted cmyg

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了E - Down or Right Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)相关的知识,希望对你有一定的参考价值。

http://codeforces.com/contest/1023/problem/E

 

交互题

 1  #include <cstdio>
 2 #include <cstdlib>
 3 #include <cmath>
 4 #include <cstring>
 5 #include <time.h>
 6 #include <string>
 7 #include <set>
 8 #include <map>
 9 #include <list>
10 #include <stack>
11 #include <queue>
12 #include <vector>
13 #include <bitset>
14 #include <ext/rope>
15 #include <algorithm>
16 #include <iostream>
17 using namespace std;
18 #define ll long long
19 #define minv 1e-6
20 #define inf 1e9
21 #define pi 3.1415926536
22 #define E  2.7182818284
23 const ll mod=1e9+7;//998244353
24 const int maxn=1e5+10;
25 
26 char S[10];
27 int s[1000],t[1000];
28 
29 int main()
30 {
31     int n,x,y,tot,xx,yy,i;
32     scanf("%d",&n);
33     x=n,y=n,tot=2*n;
34     while (x-1+y-1>=n)
35     {
36         tot--;
37         s[tot]=x;
38         t[tot]=y;
39 
40         printf("? %d %d %d %d
",1,1,x-1,y);
41         fflush(stdout);
42         scanf("%s",S);
43         if (strcmp(S,"YES")==0)
44             x--;
45         else
46             y--;
47     }
48     tot--;
49     s[tot]=x;
50     t[tot]=y;
51 
52     xx=x,yy=y;
53 
54     tot=0;
55     x=1,y=1;
56     while (x!=xx || y!=yy)
57     {
58         tot++;
59         s[tot]=x;
60         t[tot]=y;
61 
62         printf("? %d %d %d %d
",x,y+1,n,n);
63         fflush(stdout);
64         scanf("%s",S);
65         if (strcmp(S,"YES")==0)
66             y++;
67         else
68             x++;
69     }
70 
71     printf("! ");
72     for (i=2;i<=2*n-1;i++)
73         if (s[i]==s[i-1])
74             printf("R");
75         else
76             printf("D");
77     return 0;
78 }

 

以上是关于E - Down or Right Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)的主要内容,如果未能解决你的问题,请参考以下文章

Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) E. Down or Right

qt 键盘事件Key_Left,Right,Up,Down事件捕捉不了,而A,S,D,W能捕捉,为啥啊

[leetcode] Binary Tree Upside Down

如果 Either 可以是 Left 或 Right 但不能同时是两者,那么为啥在 Curry-Howard 对应关系中它对应的是 OR 而不是 XOR?

机器人运动例子

MouseGestureL.ini shift up/down/left/right edge