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 ...
随机推荐
- JS获取链接中的参数
/*获取当前页面链接中的参数*/ function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + ...
- AJ学IOS 之微博项目实战(12)发送微博自定义工具条代理实现点击事件
AJ分享,必须精品 一:效果 二:封装好的工具条 NYComposeToolbar.h 带代理方法 #import <UIKit/UIKit.h> typedef enum { NYCom ...
- git以及gitHub的使用说明书
一.使用说明 1.Git与github的功能: Git是世界上最先进的分布式版本控制系统,也就是用来记录你的项目代码历史变更信息的工具:github就是用来存储你的代码以及变更信息的云端平台: 2.优 ...
- stand up meeting 12/25/2015 & weekend 12/26/2015~12/27/2015
part 组员 工作 工作耗时/h 明日计划 工作耗时/h UI 冯晓云 在pdf阅读页面添加生词本显示:UI美化 6 完善显示 ...
- R - C Looooops POJ - 2115 (exgcd)
题目大意:很好理解,一个for循环语句,从a开始到b结束,步长是c,模数是pow(2,k) 问,最少循环多少次,才能到达b,如果永远都到不了b,输出FOREVER 题解:其实就是求一个线性方程,cx= ...
- Android内存优化—dumpsys meminfo详解
原创置顶 不死鸟JGC 最后发布于2018-12-24 14:19:28 阅读数 3960 收藏展开dumpsys 介绍Dumpsys用户系统诊断,它运行在设备上,并提供系统服务状态信息 命令格式: ...
- PHP函数:array_chunk
array_chunk() - 将一个数组分割成多个. 说明: array_chunk ( array $array , int $size [, bool $preserve_keys = fa ...
- .NET中 kafka消息队列、环境搭建与使用
前面几篇文章中讲了一些关于消息队列的知识,就每中消息队列中间件,我们并没有做详细的讲解,那么,今天我们就来详细的讲解一下消息队列之一kafka的一些基本的使用与操作. 一.kafka介绍 kafka: ...
- Canvas(3)---绘制饼状图
Canvas(3)---绘制饼状图 有关canvas之前有写过两篇文章 1.Canvas(1)---概述+简单示例 2.Canvas(2)---绘制折线图 在绘制饼状图之前,我们先要理解什么是圆弧,如 ...
- python face_recognition模块实现人脸识别
import face_recognition #人脸识别库 pip cmake dlib import cv2 #读取图像 face_image1 = face_recognition.load_i ...