E. XOR Guessing 交互题 Educational Codeforces Round 71 (Rated for Div. 2)
交互题。
因为这个数最多只有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)的更多相关文章
- Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题
Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题 [Problem Description] 总共两次询 ...
- Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块
Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块 [Problem Description] ...
- 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 ...
- Educational Codeforces Round 71 (Rated for Div. 2)
传送门 A.There Are Two Types Of Burgers 签到. B.Square Filling 签到 C.Gas Pipeline 每个位置只有"高.低"两种状 ...
- Educational Codeforces Round 71 (Rated for Div. 2) Solution
A. There Are Two Types Of Burgers 题意: 给一些面包,鸡肉,牛肉,你可以做成鸡肉汉堡或者牛肉汉堡并卖掉 一个鸡肉汉堡需要两个面包和一个鸡肉,牛肉汉堡需要两个面包和一个 ...
- XOR Guessing(交互题+思维)Educational Codeforces Round 71 (Rated for Div. 2)
题意:https://codeforc.es/contest/1207/problem/E 答案guessing(0~2^14-1) 有两次机会,内次必须输出不同的100个数,每次系统会随机挑一个你给 ...
- Educational Codeforces Round 71 (Rated for Div. 2)E. XOR Guessing
一道容斥题 如果直接做就是找到所有出现过递减的不同排列,当时硬钢到自闭,然后在凯妹毁人不倦的教导下想到可以容斥做,就是:所有的排列设为a,只考虑第一个非递减设为b,第二个非递减设为c+两个都非递减的情 ...
- 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 ...
- [贪心,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 ...
随机推荐
- tf.nn.relu 激活函数
tf.nn.relu(features, name = None) 计算校正线性:max(features, 0) 参数: features:一个Tensor.必须是下列类型之一:float32,fl ...
- 【漏洞通告】Linux Kernel 信息泄漏&权限提升漏洞(CVE-2020-8835)通告
0x01漏洞简介: 3月31日, 选手Manfred Paul 在Pwn2Own比赛上用于演示Linux内核权限提升的漏洞被CVE收录,漏洞编号为CVE-2020-8835.此漏洞由于bpf验证系统在 ...
- AJ学IOS(27)UI之iOSUIKit字符属性NSAttributedString概述
AJ分享,必须精品 UIKit字符属性NSAttributedString概述 字符属性 字符属性可以应用于 attributed string 的文本中. NSString *const NSFon ...
- V - Infinite Prefixes CodeForces - 1295B math
天哪!!菜到家啦. 数学+思维. 首先求出一个周期内cnt0-cnt1=c的个数,如果C=0,那么只要在一个周期内有前缀等于x,那么答案就是-1,否则答案就是0 如果C!=0,列一下方程x=t*c+a ...
- 2.react-插件
PC: antd(蚂蚁金服)https://ant.design/index-cn 移动: mobile-antd(蚂蚁金服)https://mobile.ant.design =========== ...
- 模糊字符串匹配:FuzzyWuzzy
FuzzyWuzzy 模糊字符串匹配,它使用Levenshtein Distance来计算简单易用的包中序列之间的差异. 前置条件 Python 2.7 or higher difflib pytho ...
- react typescript jest config (一)
1. initialize project create a folder project Now we'll turn this folder into an npm package. npm in ...
- Mysql链接查询
连接查询--交叉连接将两张表的数据与另外一张表彼此交叉原理:1. 从第一张表一次取出每一条记录2. 取出每一条记录之后,与另外一张表的全部记录挨个匹配3. 没有任何匹配条件,所有的结果都会进行保留4. ...
- fashion_mnist多分类训练,两种模型的保存与加载
from tensorflow.python.keras.preprocessing.image import load_img,img_to_array from tensorflow.python ...
- Python软件定时器APScheduler使用【软件定时器,非操作系统定时器,软件可控的定时器】【用途:定时同步数据库和缓存等】【刘新宇】
APScheduler使用 APScheduler (advanceded python scheduler)是一款Python开发的定时任务工具. 文档地址 https://apscheduler. ...