CodeForces - 869A The Artful Expedient
题意:有两个序列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的更多相关文章
- codeforces 869A The Artful Expedient【暴力枚举/亦或性质】
A. time limit per test 1 second memory limit per test 256 megabytes input standard input output stan ...
- Codeforces Round #439 (Div. 2) A. The Artful Expedient
A. The Artful Expedient 题目链接http://codeforces.com/contest/869/problem/A 解题心得:就是一个水题,读懂题就好,题意是,(i,j)a ...
- codeforces 869A/B/C
A. The Artful Expedient time limit per test 1 second memory limit per test 256 megabytes input stand ...
- codeforces 869A
A. The Artful Expedient time limit per test 1 second memory limit per test 256 megabytes input stand ...
- 【Codeforces Round #439 (Div. 2) A】The Artful Expedient
[链接] 链接 [题意] [题解] 暴力 [错的次数] 在这里输入错的次数 [反思] 在这里输入反思 [代码] #include <bits/stdc++.h> using namespa ...
- Codeforces Round #439 (Div. 2) Problem A (Codeforces 869A) - 暴力
Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-sc ...
- 【CF Round 439 A. The Artful Expedient】
time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...
- Codeforces Round #439 (Div. 2)
A. The Artful Expedient 题目链接:http://codeforces.com/contest/869/problem/A 题目意思:给你两个数列,各包含n个数,现在让你从上下两 ...
- Codeforces Round #439 (Div. 2)【A、B、C、E】
Codeforces Round #439 (Div. 2) codeforces 869 A. The Artful Expedient 看不透( #include<cstdio> in ...
随机推荐
- LNMP架构及应用部署!(重点)
LNMP代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构. WNMP代表的就是:Windows系统下Nginx+MySQL+PHP这种网站服务器架构. WAMP代表的就是: ...
- Vue专题系列
一. 简介 1. 说明 Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架.与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用.Vue 的核心库只关注视图 ...
- String类为什么是不可变的
String类为啥是final的? 我们找到string的jdk源码 1.看到String类被final修饰.这里你就要说出被final修饰的类不能被继承,方法不能被重写,变量不能被修改. 2.看到f ...
- centos初始化脚本
centos初始化脚本 添加IP.主机名.挂载/dev/sdb1磁盘 #!/bin/bash # ip=$ hostname=$ if [ -z $ip ] || [ -z $hostname ]; ...
- Sonic_cli常用命令
用户名:admin 密码:YourPaSsWoRd //change password1>admin@sonic:~$ passwdChanging password for admin.(cu ...
- Docker示例命令
1.docker run -t -i -v /root/workspace/node:/home/exam:rw docker.io/node bin/sh -t 给容器挂载一个伪终端 - ...
- (任意进制转换)将 r 进制数转成 k 进制数
我们知道任意进制转换为十进制,都是乘以基数的多少次方,然后相加: 十进制转换为任意进制,都是除以基数,然后倒着取余数: 所以这里是用十进制数中转,实现任意进制数的转换 #include<iost ...
- day 10 作业
# 2.写函数,接收n个数字,求这些参数数字的和. def sum_func(*args): total = 0 for i in args: total += i return total prin ...
- Spring 中 bean 的生命周期?
参考:https://www.cnblogs.com/kenshinobiy/p/4652008.html Spring Bean 生命周期如下: 1:Bean的建立: 容器寻找Bean的定义信息并将 ...
- vue-element-admin 引入高德地图并做海量点标记
第一步: 首先在index.html入口文件中添加引入高德地图的js,并填写自己在官网申请的key.如果没有申请不填写也是可以的. plugin:项目中如果有需要引入插件则使用没有直接去掉就行. &l ...