A.

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard 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 andy1, 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 = yji ≠ j and xi = xji ≠ 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.

Examples
input
3
1 2 3
4 5 6
output
Karen
input
5
2 4 6 8 10
9 7 5 3 1
output
Karen
Note

In the first example, there are 6 pairs satisfying the constraint: (1, 1), (1, 2), (2, 1), (2, 3), (3, 2) and (3, 3). Thus, Karen wins since 6 is an even number.

In the second example, there are 16 such pairs, and Karen wins again.

【题意】:判断a[i]^b[j]==a或b中的一个的pair数量的奇偶 。

【分析】:枚举/亦或性质永远是Karen win

【代码】:

#include <bits/stdc++.h>

using namespace std;
int mp[*];
int a[],b[]; int main()
{
int n;
cin>>n;
for(int i=;i<=n;i++)
{
cin>>a[i];
mp[ a[i] ]=;
}
for(int i=;i<=n;i++)
{
cin>>b[i];
mp[ b[i] ]=;
}
int cnt=;
for(int i=;i<=n;i++)
{
for(int j=;j<=n;j++)
{
if( mp[ a[i]^b[j] ] )
cnt++;
}
}
if(cnt&) cout<<"Koyomi"<<endl;
else cout<<"Karen"<<endl;
return ;
}

暴力

#include <bits/stdc++.h>

using namespace std;

int main()
{
cout<<"Karen"<<endl;
return ;
}

magic

codeforces 869A The Artful Expedient【暴力枚举/亦或性质】的更多相关文章

  1. CodeForces - 869A The Artful Expedient

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

  2. D. Diverse Garland Codeforces Round #535 (Div. 3) 暴力枚举+贪心

    D. Diverse Garland time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  3. Codeforces 626D Jerry's Protest(暴力枚举+概率)

    D. Jerry's Protest time limit per test:2 seconds memory limit per test:256 megabytes input:standard ...

  4. codeforces 675B B. Restoring Painting(暴力枚举)

    题目链接: B. Restoring Painting time limit per test 1 second memory limit per test 256 megabytes input s ...

  5. CodeForces - 593A -2Char(思维+暴力枚举)

    Andrew often reads articles in his favorite magazine 2Char. The main feature of these articles is th ...

  6. Codeforces Round #349 (Div. 1) B. World Tour 最短路+暴力枚举

    题目链接: http://www.codeforces.com/contest/666/problem/B 题意: 给你n个城市,m条单向边,求通过最短路径访问四个不同的点能获得的最大距离,答案输出一 ...

  7. Codeforces Round #298 (Div. 2) B. Covered Path 物理题/暴力枚举

    B. Covered Path Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/534/probl ...

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

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

  9. Codeforces 425A Sereja and Swaps(暴力枚举)

    题目链接:A. Sereja and Swaps 题意:给定一个序列,能够交换k次,问交换完后的子序列最大值的最大值是多少 思路:暴力枚举每一个区间,然后每一个区间[l,r]之内的值先存在优先队列内, ...

随机推荐

  1. BZOJ4484 JSOI2015最小表示(拓扑排序+bitset)

    考虑在每个点的出边中删除哪些.如果其出边所指向的点中存在某点能到达另一点,那么显然指向被到达点的边是没有用的.于是拓扑排序逆序处理,按拓扑序枚举出边,bitset维护可达点集合即可. #include ...

  2. DataBase -- Employees Earning More Than Their Managers My Submissions Question

    Question: The Employee table holds all employees including their managers. Every employee has an Id, ...

  3. Lua学习笔记:面向对象

    Lua学习笔记:面向对象 https://blog.csdn.net/liutianshx2012/article/details/41921077 Lua 中只存在表(Table)这么唯一一种数据结 ...

  4. 深入理解Netscaler INat

    深入理解Netscaler INat http://blog.51cto.com/caojin/1898173 Netscaler的INat主要是用作基于目的地址的转换,将client访问的公网IP通 ...

  5. win7中输入文件夹首字母跳到相应的文件或者文件夹,却在搜索栏出现输入的字母

    组织->文件夹和搜索选项->查看->在视图中选择键入项

  6. [Leetcode] spiral matrix ii 螺旋矩阵

    Given an integer n, generate a square matrix filled with elements from 1 to n 2 in spiral order. For ...

  7. 【BZOJ 4198】[Noi2015]荷马史诗 哈夫曼编码

    合并果子加强版....... 哈夫曼树是一种特别的贪心算法,它的作用是使若干个点合并成一棵树,每次合并新建一个节点连接两个合并根并形成一个新的根,使叶子节点的权值乘上其到根的路径长的和最短(等价于每次 ...

  8. 湖南大学第十四届ACM程序设计新生杯 Dandan's lunch

    Dandan's lunch Description: As everyone knows, there are now n people participating in the competiti ...

  9. centos关闭ipv6

    1.使用lsmod查看ipv6的模块是否被加载. lsmod | grep ipv6 [root@dmhadoop011 ~]# lsmod | grep ipv6 ipv6              ...

  10. 公共css

    * { margin: 0; padding: 0; word-break: break-all; font-family: Microsoft YaHei, tahoma, arial, Hirag ...