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 ...
随机推荐
- Java14:你需要知道的新特性
基本介绍 2020 年 3 月 17 日,JDK / Java 14 正式 GA(General Available).这是自从 Java 采用六个月一次的发布周期之后的第五次发布. 此版本包含的 J ...
- ClassLoader类加载器浅见
类加载器 类加载器,它拿到.class文件,它会把他拆成两部分,将static数据转换成方法区的数据结构,然后把他放在了方法区之中. 然后在堆里面建一个类对象(Class,它可以用来实例化对象),然后 ...
- 跨平台开源密码管理器 KeePassXC
简介 KeePassXC 是一个开源的跨平台密码管理器.基于 KeePass 二次开发. KeePassXC 可以安全地在本地存储您的密码,配合浏览器插件KeePassXC-Browser可辅助登录. ...
- Problem E. Bet
转载:https://blog.csdn.net/qq_40861916/article/details/84403731 #include<iostream> #include<c ...
- go 基础 结构体
结构体是类型中带有成员的复合类型.go语言使用结构体和结构体成员来描述真实世界的实体和实体对应的各种属性. go语言中的类型可以被实例化,使用new和&构造类型实例的类型是类型的指针. 结构体 ...
- react: typescript import images alias
1.webpack.config.js resolve: { extensions: ["ts", "tsx", "js", "j ...
- C# 基础知识系列- 14 IO篇之入门IO
0. 前言 在之前的章节中,大致介绍了C#中的一些基本概念.这篇我们将介绍一下C#的I/O操作,这将也是一个小连续剧.这是第一集,我们先来简单了解一下C#中的I/O框架. 1. 什么是I/O I/O ...
- Mac home 目录下创建文件夹
example:sudo vim /etc/auto_master before: # Automounter master map +auto_master # Use directory serv ...
- curl请求curl_exec返回false,curl_error返回空
网上查找了一下,由于采用https协议,一定要加入以下两句 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //不验证证书下同 curl_setopt ...
- Vue3.0新版API之composition-api入坑指南
关于VUE3.0 由于vue3.0语法跟vue2.x的语法几乎是完全兼容的,本文主要介绍了如何使用composition-api,主要分以下几个方面来讲 使用vite体验vue3.0 composit ...