E. XOR Guessing

交互题。

因为这个数最多只有14位 0~13,所以我们可以先处理后面7位,然后再处理后面7位。

因为异或的性质,如果一个数和0异或,那么就等于本身。

所以我们第一次异或1~100 所以 后面从7到13位就都是0,所以结果的后面的7位就可以算出来。

然后同理可以把前面七位找到。

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <iostream>
#include <string>
#include <map>
#define inf 0x3f3f3f3f
#define inf64 0x3f3f3f3f3f3f3f3f
using namespace std;
const int maxn = 3e5 + ;
typedef long long ll; int main() {
ll ans = ;
printf("?");
for (int i = ; i <= ; i++) printf(" %d", i);
printf("\n");
fflush(stdout);
ll num;
scanf("%lld", &num);
for(int i=;i<;i++) ans += ((num >> i) & ) << i;
printf("?");
for (int i = ; i <= ; i++) printf(" %d", i << );
printf("\n");
fflush(stdout);
scanf("%lld", &num);
for (int i = ; i < ; i++) ans += ((num >> i) & ) << i;
printf("! %lld\n", ans);
return ;
}

E. XOR Guessing 交互题 Educational Codeforces Round 71 (Rated for Div. 2)的更多相关文章

  1. Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题

    Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题 [Problem Description] ​ 总共两次询 ...

  2. Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块

    Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块 [Problem Description] ​ ...

  3. Educational Codeforces Round 71 (Rated for Div. 2) E XOR Guessing (二进制分组,交互)

    E. XOR Guessing time limit per test1 second memory limit per test256 megabytes inputstandard input o ...

  4. Educational Codeforces Round 71 (Rated for Div. 2)

    传送门 A.There Are Two Types Of Burgers 签到. B.Square Filling 签到 C.Gas Pipeline 每个位置只有"高.低"两种状 ...

  5. Educational Codeforces Round 71 (Rated for Div. 2) Solution

    A. There Are Two Types Of Burgers 题意: 给一些面包,鸡肉,牛肉,你可以做成鸡肉汉堡或者牛肉汉堡并卖掉 一个鸡肉汉堡需要两个面包和一个鸡肉,牛肉汉堡需要两个面包和一个 ...

  6. XOR Guessing(交互题+思维)Educational Codeforces Round 71 (Rated for Div. 2)

    题意:https://codeforc.es/contest/1207/problem/E 答案guessing(0~2^14-1) 有两次机会,内次必须输出不同的100个数,每次系统会随机挑一个你给 ...

  7. Educational Codeforces Round 71 (Rated for Div. 2)E. XOR Guessing

    一道容斥题 如果直接做就是找到所有出现过递减的不同排列,当时硬钢到自闭,然后在凯妹毁人不倦的教导下想到可以容斥做,就是:所有的排列设为a,只考虑第一个非递减设为b,第二个非递减设为c+两个都非递减的情 ...

  8. Codeforces 1082 D. Maximum Diameter Graph-树的直径-最长链-构造题 (Educational Codeforces Round 55 (Rated for Div. 2))

    D. Maximum Diameter Graph time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  9. [贪心,dp] Educational Codeforces Round 71 (Rated for Div. 2) C. Gas Pipeline (1207C)

    题目:http://codeforces.com/contest/1207/problem/C   C. Gas Pipeline time limit per test 2 seconds memo ...

随机推荐

  1. springIoc中的单列对象的分析

    最近有个同事去面试,其中有一个问题是关于spring单例的.本篇博文就发表一下小编我自己的理解~~. 使用过spring的程序猿应该都知道,我们的bean(controller.service和Dao ...

  2. 一个不错的intellj 相关的博客

    http://my.oschina.net/lujianing/blog?catalog=3300430

  3. 【python实现卷积神经网络】批量归一化层实现

    代码来源:https://github.com/eriklindernoren/ML-From-Scratch 卷积神经网络中卷积层Conv2D(带stride.padding)的具体实现:https ...

  4. 1.Git 安装

    Git的安装 阿里云镜像去下载 阿里云的镜像地址 卸载Git 1.首先在系统环境变量->path->里面去清理掉git相关的环境变量 2.然后控制面板卸载 安装Git 一直下一步即可 使用 ...

  5. L22 Data Augmentation数据增强

    数据 img2083 链接:https://pan.baidu.com/s/1LIrSH51bUgS-TcgGuCcniw 提取码:m4vq 数据cifar102021 链接:https://pan. ...

  6. Beta-release 目标

    在第二个release开发周期中我们首要先要完成的是对第一个发布版本的优化:(之前团队在跟travis的沟通中,travis也要求我们首先要把现在已有的feature做到一个比较成熟和稳定的版本) 1 ...

  7. 前端架构演进及主流UI

    @ 目录 前端三要素 JavaScript 框架 NodeJs 常用UI框架 前后端分离的演进 MVVM模式 总结 前端演进到现在,各种技术框架已经层出不穷了,作为一名开发少不了要干一些前端的活儿,那 ...

  8. mapstruct使用详解

    我们都知道,随着一个工程的越来越成熟,模块划分会越来越细,其中实体类一般存于 domain 之中,但 domain 工程最好不要被其他工程依赖,所以其他工程想获取实体类数据时就需要在各自工程写 mod ...

  9. 性能测试-pidstat 问题定位分析

    pidstat 概述 pidstat是sysstat工具的一个命令,用于监控全部或指定进程的cpu.内存.线程.设备IO等系统资源的占用情况.pidstat首次运行时显示自系统启动开始的各项统计信息, ...

  10. vue-cli目录结构分析

    vue3初始化一个项目,查看其项目结构,会发现比vue2的更加简洁. package.json说明 项目的配置文件,定义了项目的基本信息以及项目的相关包依赖,npm运行命令等,位于项目根目录. scr ...