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 xormeans 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
  1. 3
    1 2 3
    4 5 6
output
  1. Karen
input
  1. 5
    2 4 6 8 10
    9 7 5 3 1
output
  1. 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.


  题目大意 给定两组数,每组中各选一个数异或得到后的结果在这两组数中出现过的方案数如果是偶数就是Karen赢,否则是Koyomi赢。

  暴力for,开个数组去check。完事。

Code

  1. /**
  2. * Codeforces
  3. * Problem#869A
  4. * Accepted
  5. * Time: 280ms
  6. * Memory: 100k
  7. */
  8. #include <bits/stdc++.h>
  9. using namespace std;
  10.  
  11. int n;
  12. int *x, *y;
  13. set<int> been;
  14.  
  15. inline void init() {
  16. scanf("%d", &n);
  17. x = new int[(n + )];
  18. y = new int[(n + )];
  19. for(int i = ; i <= n; i++)
  20. scanf("%d", x + i), been.insert(x[i]);
  21. for(int i = ; i <= n; i++)
  22. scanf("%d", y + i), been.insert(y[i]);
  23. }
  24.  
  25. int counter = ;
  26. inline void solve() {
  27. for(int i = ; i <= n; i++)
  28. for(int j = ; j <= n; j++)
  29. if(been.count(x[i] ^ y[j])) {
  30. counter++;
  31. }
  32. if(counter & ) puts("Koyomi");
  33. else puts("Karen");
  34. }
  35.  
  36. int main() {
  37. init();
  38. solve();
  39. return ;
  40. }

Codeforces Round #439 (Div. 2) Problem A (Codeforces 869A) - 暴力的更多相关文章

  1. Codeforces Round #439 (Div. 2) Problem E (Codeforces 869E) - 暴力 - 随机化 - 二维树状数组 - 差分

    Adieu l'ami. Koyomi is helping Oshino, an acquaintance of his, to take care of an open space around ...

  2. Codeforces Round #439 (Div. 2) Problem C (Codeforces 869C) - 组合数学

    — This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii ...

  3. Codeforces Round #439 (Div. 2) Problem B (Codeforces 869B)

    Even if the world is full of counterfeits, I still regard it as wonderful. Pile up herbs and incense ...

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

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

  5. Codeforces Round #716 (Div. 2), problem: (B) AND 0, Sum Big位运算思维

    & -- 位运算之一,有0则0 原题链接 Problem - 1514B - Codeforces 题目 Example input 2 2 2 100000 20 output 4 2267 ...

  6. Codeforces Round #297 (Div. 2)D. Arthur and Walls 暴力搜索

    Codeforces Round #297 (Div. 2)D. Arthur and Walls Time Limit: 2 Sec  Memory Limit: 512 MBSubmit: xxx ...

  7. Codeforces Round #753 (Div. 3), problem: (D) Blue-Red Permutation

    还是看大佬的题解吧 CFRound#753(Div.3)A-E(后面的今天明天之内补) - 知乎 (zhihu.com) 传送门  Problem - D - Codeforces 题意 n个数字,n ...

  8. Codeforces Round #771 (Div. 2), problem: (B) Odd Swap Sort

    Problem - B - Codeforces 就是给你个序列, 给他整成升序的, 每次操作可以使相邻两个数交换位置, 交换条件是二数之和为奇数 结果只需输出是否可以整成升序的 思路: 需要奇数偶数 ...

  9. Codeforces Round #306 (Div. 2), problem: (B) Preparing Olympiad【dfs或01枚举】

    题意: 给出n个数字,要求在这n个数中选出至少两个数字,使得它们的和在l,r之间,并且最大的与最小的差值要不小于x.n<=15 Problem - 550B - Codeforces 二进制 利 ...

随机推荐

  1. 关于fullpage.js 和animate.css制作全屏简单大方的首页

    附上源码: html <!DOCTYPE html><html lang="en"><head> <meta charset=" ...

  2. 一个tomcat下,两个系统的jar包可以相互引用。

    将道路挖占管理系统(rems)从交通设备设施系统(tms)中剥离出去以后,在本地调试的时候是在同一个Tomcat下启动的,上传文件成功. 然后部署到西安以后,分成两个tomcat以后,发现rems上传 ...

  3. 笔记 : windows系统下 命令行 php --version 的版本与phpinfo()版本不一致问题

    第一 : php --version命令cmd不随wamp中php版本改变而改变的, php命令是随着wamp安装时将:wamp/bin/php/php5.6.25[版本]自动或手动添加到环境变量, ...

  4. css3d旋转

    一.包裹层添加 -webkit-perspective: 800px; -moz-perspective: 800px; 使子元素获得3D效果支持   二.自持子元素需支持3D效果 -webkit-t ...

  5. [7] Windows内核情景分析---线程同步

    基于同步对象的等待.唤醒机制: 一个线程可以等待一个对象或多个对象而进入等待状态(也叫睡眠状态),另一个线程可以触发那个等待对象,唤醒在那个对象上等待的所有线程. 一个线程可以等待一个对象或多个对象, ...

  6. kali linux android木马(内网+外网)

    1,内网木马 先生成一个小马 msfpayload -p android/meterpreter/reverse_tcp LHOST=192.168.8.104 LPORT=5555 R > a ...

  7. hdu3879 最大权闭合回路

    题意: 有n个基站可以建立,然后m个团体会使用这些基站进行工作,地i个团体会适应Ai Bi 这两个基站, 如果建成收益Ci,  第j个基站花费Pj,求如何建立使得收益最大, 将每个团体看以一个点,然后 ...

  8. 【转】SQL Server 运行状况监控SQL语句

    SQL Server 运行状况监控SQL语句   Microsoft SQL Server 2005 提供了一些工具来监控数据库.方法之一是动态管理视图.动态管理视图 (DMV) 和动态管理函数 (D ...

  9. [转][LoadRunner]LR性能测试结果样例分析

    LR性能测试结果样例分析 测试结果分析 LoadRunner性能测试结果分析是个复杂的过程,通常可以从结果摘要.并发数.平均事务响应时间.每秒点击数.业务成功率.系统资源.网页细分图.Web服务器资源 ...

  10. 20155228 2017-5-31 课堂测试:编写MyOD.java

    20155228 2017-5-31 课堂测试:编写MyOD.java 题目和要求 编写MyOD.java:用java MyOD XXX实现Linux下od -tx -tc XXX的功能 提交测试代码 ...