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

交互题

  #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <time.h>
#include <string>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>
#include <ext/rope>
#include <algorithm>
#include <iostream>
using namespace std;
#define ll long long
#define minv 1e-6
#define inf 1e9
#define pi 3.1415926536
#define E 2.7182818284
const ll mod=1e9+;//
const int maxn=1e5+; char S[];
int s[],t[]; int main()
{
int n,x,y,tot,xx,yy,i;
scanf("%d",&n);
x=n,y=n,tot=*n;
while (x-+y->=n)
{
tot--;
s[tot]=x;
t[tot]=y; printf("? %d %d %d %d\n",,,x-,y);
fflush(stdout);
scanf("%s",S);
if (strcmp(S,"YES")==)
x--;
else
y--;
}
tot--;
s[tot]=x;
t[tot]=y; xx=x,yy=y; tot=;
x=,y=;
while (x!=xx || y!=yy)
{
tot++;
s[tot]=x;
t[tot]=y; printf("? %d %d %d %d\n",x,y+,n,n);
fflush(stdout);
scanf("%s",S);
if (strcmp(S,"YES")==)
y++;
else
x++;
} printf("! ");
for (i=;i<=*n-;i++)
if (s[i]==s[i-])
printf("R");
else
printf("D");
return ;
}

E - Down or Right Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)的更多相关文章

  1. Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)-D- Array Restoration

    我们知道不满足的肯定是两边大中间小的,这样就用RMQ查询两个相同等值的区间内部最小值即可,注意边界条件 #include<bits/stdc++.h> #define x first #d ...

  2. Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)-C-Bracket Subsequence

    #include<iostream> #include<stdio.h> #include<string.h> #include<algorithm> ...

  3. Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)-A-Single Wildcard Pattern Matching

    #include<iostream> #include<algorithm> #include<stdio.h> #include<string.h> ...

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

    从(1,1,n,n)每次只变一个坐标,进行询问. 如果问到对角线有距离限制, 再从(1,1,n/2,n/2)询问到(n/2,n/2,n,n) 记住前半部分贪心忘上走,后本部分贪心往右走 因为最后的路线 ...

  5. Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

    考场上只做出了ABDE C都挂了... 题解: A 题解: 模拟 判断前面一段是否相同,后面一段是否相同,长度是否够(不能有重叠) Code: #include<stdio.h> #inc ...

  6. D. Recovering BST Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

    http://codeforces.com/contest/1025/problem/D 树 dp 优化 f[x][y][0]=f[x][z][1] & f[z+1][y][0] ( gcd( ...

  7. Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) -B C(GCD,最长连续交替序列)

    B. Weakened Common Divisor time limit per test 1.5 seconds memory limit per test 256 megabytes input ...

  8. Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) B. Weakened Common Divis

    题目链接 让你找一个数,使得这个数,可以被每个二元组的两个数中的一个数整除. 先将第一个二元组的两个数质因数分解一下,分解的质数加入set中,然后,对剩下的n-1个二元组进行遍历,每次遍历到的二元组对 ...

  9. Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

    A : A. Doggo Recoloring time limit per test 1 second memory limit per test 256 megabytes input stand ...

随机推荐

  1. i++ i+=1 i=i+1 汇编代码效率比较

    结论:一样.编译器和编译器之间可能有点区别但是程序不会变. 0x00 一直不清楚到底是因为懒还是真的为了效率,要把" i = i + 1 "写成" i++ "或 ...

  2. 关于linux下的命令

    1.文件和目录操作命令 pwd:显示当前的工作目录 cd:切换目录 tree:以树形结构图显示目录下的所有内容 mkdir:创建目录 touch:创建空文件或改变文件的时间戳属性 ls:显示目录下的内 ...

  3. mysql更新表数据时报错 You can't specify target table 'RES_CATALOG_CLASSIFY' for update in FROM clause

    You can't specify target table for update in FROM clause含义:不能在同一表中查询的数据作为同一表的更新数据. 将sql语句 UPDATE RES ...

  4. Daily Scrum 11.19 部分测试报告

    下面是我们的部分测试报告: 功能测试部分: 1Exception in thread "Thread-11" java.lang.IllegalArgumentException: ...

  5. 课堂讨论—Alpha版总结会议

    我们在课堂上针对第一阶段冲刺过程中存在的问题,展开了激烈的讨论,并投票选出需要改进的最主要三个问题. 有图有真相:

  6. <!CDATA[]]用法详解

    所有 XML 文档中的文本均会被解析器解析. 只有 CDATA 区段(CDATA section)中的文本会被解析器忽略. PCDATA PCDATA 指的是被解析的字符数据(Parsed Chara ...

  7. Structs2笔记③--局部类型转换案例

    Structs2的类型转换-局部类型转换 Ognl强大的表达式语言,在导入项目的时候我们导入了ognl.jar包,内有TypeConverter类,struct主要依赖于他进行类型转换. 例子   i ...

  8. 【Coursera】因子分析模型

    一.协方差矩阵 协方差矩阵为对称矩阵. 在高斯分布中,方差越大,数据分布越分散,方差越小发,数据分布越集中. 在协方差矩阵中,假设矩阵为二维,若第二维的方差大于第一维的方差,则在图像上的体现就是:高斯 ...

  9. sqlserver实现树形结构递归查询(无限极分类)

    SQL Server 2005开始,我们可以直接通过CTE来支持递归查询,CTE即公用表表达式 百度百科 公用表表达式(CTE),是一个在查询中定义的临时命名结果集将在from子句中使用它.每个CTE ...

  10. selenium之数据驱动框架应用WPS个人中心自动签到

    wps在注册后,有个每日签到的功能,签到后有几率送wps的专属金币[稻米],为了免费获得,又不想每天都是人工去执行签到动作,所以用selenium写了个小脚本,准备用数据驱动框架来完成这个事情,数据驱 ...