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. 关于go语言中的WaitGroup

    如果你刚接触Go语言并且想用它构建高并发,高性能的应用,弄明白WaitGroups是怎么回事很重要. 在本教程中,我们将掌握以下内容: WaitGroups的用途 一个WaitGroups的简单示例 ...

  2. 随手记录-linux-添加epel源

    下载各种yum源 https://opsx.alibaba.com/mirror https://blog.csdn.net/harbor1981/article/details/51135623

  3. Alpha发布PSP Daily评价总结报告

    Alpha发布PSP Daily评价总结报告 优点: 1.用户人群较为明确,定位较为准确. 2.亮点:暂停任务时是无法结束当前任务的. 3.说明书写的详细.语言流畅.能实现的功能都体现出来. 4.下拉 ...

  4. final发布视频展示博客

    Part One [探路者]选题展示视频链接: http://v.youku.com/v_show/id_XMzIxMDM2MTQ1Ng==.html?spm=a2h3j.8428770.341605 ...

  5. 学习Mybatis的两个必须的jar包分享

    百度云盘:http://pan.baidu.com/s/1nuNxRcd 提取码:t765(好像不需要提取码,不太会用云盘...) 自己学习mybatis的时候去找这两个jar包也是不容易,特别分享一 ...

  6. Alpha版本测试文档

    概述 本次测试主要是为了测试是否有导致崩溃的bug,验证是否符合软件基本需求. 测试环境 硬件测试:安卓系统手机,安卓平板. 测试人员 赖彦谕,金哉仁. 实际进度 2015/11/6 – 2015/1 ...

  7. OO学习体会与阶段总结(设计与实现)

    前言   在最近的一个月的课程中,笔者对于规格化编程进行了深入的学习.运用面向对象抽象思想对编写的程序进行过程抽象.异常处理.数据抽象.类的层次规格与迭代等等规格设计,使得程序结构化程度提高,具有更好 ...

  8. iOS学习资源搜集

    swift 2.0 新的开始 iOS7初学者入门 斯坦福大学公开课:iOS 8开发 苹果官方开发 中文 iOS/Mac 开发博客列表    git

  9. jQuery全屏滚动插件fullPage使用

    1. 引入jquery.js和jquery.fullPage.min.js <script src="jquery.min.js"></script> &l ...

  10. 文件名命工具类(将指定目录下的文件的type类型的文件,进行重命名,命名后的文件将去掉type)

    import java.io.File; /** * <b>function:</b> 文件命名工具类 * @author hoojo * @createDate 2012-5 ...