博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[CodeForces869A]The Artful Expedient
阅读量:5373 次
发布时间:2019-06-15

本文共 2304 字,大约阅读时间需要 7 分钟。

Description

outputstandard output

Rock... Paper!

After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up with a new game as a substitute. The game works as follows.

A positive integer n is decided first. Both Koyomi and Karen independently choose n distinct positive integers, denoted by x1, x2, ..., xn and y1, y2, ..., yn respectively. They reveal their sequences, and repeat until all of 2n integers become distinct, which is the only final state to be kept and considered.

Then they count the number of ordered pairs (i, j) (1 ≤ i, j ≤ n) such that the value xi xor yj equals to one of the 2n integers. Here xor means the bitwise exclusive or operation on two integers, and is denoted by operators ^ and/or xor in most programming languages.

Karen claims a win if the number of such pairs is even, and Koyomi does otherwise. And you're here to help determine the winner of their latest game.

Input

The first line of input contains a positive integer n (1 ≤ n ≤ 2 000) — the length of both sequences.

The second line contains n space-separated integers x1, x2, ..., xn (1 ≤ xi ≤ 2·106) — the integers finally chosen by Koyomi.

The third line contains n space-separated integers y1, y2, ..., yn (1 ≤ yi ≤ 2·106) — the integers finally chosen by Karen.

Input guarantees that the given 2n integers are pairwise distinct, that is, no pair (i, j) (1 ≤ i, j ≤ n) exists such that one of the following holds: xi = yj; i ≠ j and xi = xj; i ≠ j and yi = yj.

Output

Output one line — the name of the winner, that is, "Koyomi" or "Karen" (without quotes). Please be aware of the capitalization.

Sample Input

3

1 2 3
4 5 6

Sample Output

Karen

Sample Input

5

2 4 6 8 10
9 7 5 3 1

Sample Output

Karen

题解

如果a xor b == c,则a xor c == b, b xor c == a;

因为要求a,b位于不同序列,所以一对合法数对只有一组对称数对,结果必为偶数,Karen必胜

#include
#include
#include
using namespace std;typedef long long LL;LL read(){ LL x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f;}int main(){ int tmp=read(); for(int i=1,lim=tmp<<1;i<=lim;i++)tmp=read(); cout<<"Karen\n"; return 0;}

转载于:https://www.cnblogs.com/ljzalc1022/p/8757061.html

你可能感兴趣的文章
面向对象
查看>>
lintcode83- Single Number II- midium
查看>>
[工具] Sublime Text 使用指南
查看>>
#10015 灯泡(无向图连通性+二分)
查看>>
Data Structure 基本概念
查看>>
[搬运] 写给 C# 开发人员的函数式编程
查看>>
Spring Cloud Stream消费失败后的处理策略(三):使用DLQ队列(RabbitMQ)
查看>>
As-If-Serial 理解
查看>>
洛谷P1005 矩阵取数游戏
查看>>
无线通信基础(一):无线网络演进
查看>>
关于python中带下划线的变量和函数 的意义
查看>>
linux清空日志文件内容 (转)
查看>>
MySQL-EXPLAIN执行计划Extra解释
查看>>
图片点击轮播(三)-----2017-04-05
查看>>
java中new一个对象和对象=null有什么区别
查看>>
字母和数字键的键码值(keyCode)
查看>>
01_1_准备ibatis环境
查看>>
JavaScript中的BOM和DOM
查看>>
spring注入Properties
查看>>
jmeter(五)创建web测试计划
查看>>