题意:有两个序列X和Y,各含n个数,这2n个数互不相同,若满足xi^yj的结果在序列X内或序列Y内的(xi,yj)对数为偶数,则输出"Karen",否则输出"Koyomi".

分析:

1、暴力方法不再赘述。

2、

(1)若xi ^ yj的结果在序列X内,假设这个数为xk,即xi ^ yj = xk,根据异或定理,可得xk ^ yj = xi,

即(xi, yj)和(xk, yj)都是满足要求的对。

(2)若xi ^ yj的结果在序列Y内,假设这个数为yk,即xi ^ yj = yk,根据异或定理,可得xi ^ yk = yj,

即(xi, yj)和(xi, yk)都是满足要求的对。

满足要求的(xi, yj)对都是成对出现,因此结果一定是偶数个,输出"Karen"即可。

CodeForces - 869A The Artful Expedient的更多相关文章

  1. codeforces 869A The Artful Expedient【暴力枚举/亦或性质】

    A. time limit per test 1 second memory limit per test 256 megabytes input standard input output stan ...

  2. Codeforces Round #439 (Div. 2) A. The Artful Expedient

    A. The Artful Expedient 题目链接http://codeforces.com/contest/869/problem/A 解题心得:就是一个水题,读懂题就好,题意是,(i,j)a ...

  3. codeforces 869A/B/C

    A. The Artful Expedient time limit per test 1 second memory limit per test 256 megabytes input stand ...

  4. codeforces 869A

    A. The Artful Expedient time limit per test 1 second memory limit per test 256 megabytes input stand ...

  5. 【Codeforces Round #439 (Div. 2) A】The Artful Expedient

    [链接] 链接 [题意] [题解] 暴力 [错的次数] 在这里输入错的次数 [反思] 在这里输入反思 [代码] #include <bits/stdc++.h> using namespa ...

  6. Codeforces Round #439 (Div. 2) Problem A (Codeforces 869A) - 暴力

    Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-sc ...

  7. 【CF Round 439 A. The Artful Expedient】

    time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...

  8. Codeforces Round #439 (Div. 2)

    A. The Artful Expedient 题目链接:http://codeforces.com/contest/869/problem/A 题目意思:给你两个数列,各包含n个数,现在让你从上下两 ...

  9. Codeforces Round #439 (Div. 2)【A、B、C、E】

    Codeforces Round #439 (Div. 2) codeforces 869 A. The Artful Expedient 看不透( #include<cstdio> in ...

随机推荐

  1. html js中的引号

    content = "<a class='btn' href='javascript:void(0)' onclick='change('orders/orderTail.do?ode ...

  2. springBoot整合mybatis-plus关闭自动转换小驼峰命名规则

    增加配置信息 mybatis-plus: configuration: map-underscore-to-camel-case: false

  3. linux服务器自动备份与删除postgres数据库数据

    1.先创一个back.sh 文件,授权,然后在下面这个文件添加脚本 export PGPASSWORD='123456'        #这是登录服务器密码cur_time=`date +%Y%m%d ...

  4. ZeroTier 局域网组建工具

    无公网IP通过ZeroTier实现内网穿透 需求:想要在公司访问家里内网NAS,或是在家里访问公司服务 有固定的公网IP或动态的公网IP:常见的方案动态域名解析做端口转发方式等 无公网IP:常见的实现 ...

  5. java 8时间使用LocalDateTime,ZonedDateTime,LocalDate

    前言 java 8的时间已经能够满足日常的使用,也方便理解.joda-time作为一个有优秀的时间组件也不得不告知使用者在java 8以后使用自带的时间 LocalDateTime以及ZonedDat ...

  6. Navigation源码(一) move_base最全解析

    一.概述 目测是全网最全的解析,花了几个小时通读并整理的,供大家参考学习. 概况的话可以看下古月居 https://www.guyuehome.com/270,其实它是翻译官方的,英语ok的可以去ro ...

  7. 在PyCharm中自动添加文件头、时间日期等信息

    初次安装使用PyCharm,在新建.py文件时会发现文件头并没有什么信息,因此,使用模板会比较方便.方法如下: 1.打开PyCharm,选择File--Settings 2.依次选择Editor--- ...

  8. html常用整理

    视频链接:https://www.bilibili.com/video/av5862916?from=search&seid=12139895566389560177 我的第一个html &l ...

  9. uniGUI之MainModule(12)

    1]必须设置.  一个 user 一个, 在此放数据库控件是各 user 独立 2]常用属性: 应用 MainModule 正确的方法是将连接组件放置在 MainModule 上, 并将数据集放在窗体 ...

  10. python组合数据类型和数据结构

    //2019.12-071.pyhton里面组合数据类型主要有三种:集合(set).序列(字符串str.列表list and 元组tuple)和映射(字典dic)2.集合类型一般使用大括号{}来进行表 ...