304566: CF869A. The Artful Expedient

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

The Artful Expedient

题意翻译

题目描述 首先定义一个整形变量n,Koyomi和Karen都会分别选择n个不同的正整数,分别表示为X1,X2,...Xn和Y1,Y2,...Yn。它们不断重复显示它们的序列,并一直重复直到所有2n个整数变得不同,此时,这是唯一被保留和考虑的最终状态。 他们需要计算满足有序数对(i,j)[1<=i,j<=n]中(Xi ^ Yi)的值等于2n个整数之中任意一个整数的值的有序数对的数量。这里'^'意味着对两个整数的按位异或操作,并且在大多数编程语言中用'^','/'或'xor'表示 如果这样的配对数量是偶数时,Karen就可以取得胜利,否则Koyomi胜利。你需要帮助他们决出最近一场比赛的获胜者。 输入输出格式 输入格式 输入的第一行包含一个正整数n(1<=N<=2000)表示两个序列的长度。 第二行包含n个用空格分开的正整数X1,X2,...Xn(1<=Xi<=2*1e6)表示最后由Koyomi选择的正整数 第三行包含n个用空格分开的正整数Y1,Y2,...Yn(1<=Yi<=2*1e6)表示最后由Karen选择的正整数 输入数据保证给定的2n个正整数是两两不同的,也就是说,没有一对(i,j)[1<=i,j<=n]满足以下任意一项条件: 1.Xi=Yi 2.i≠j & Xi=Xj 3.i≠j & Yi=Yj 输出格式 输出一行表示获胜者的名字,即“Koyomi”或“Karen”(不含引号),注意大小写 样例解释 在样例1中,有6对满足条件的有序数对:(1,1),(1,2),(2,1),(2,3),(3,2),(3,3),因为6是偶数,所以Karen取得胜利 在样例2中,有16对满足条件的有序数对,所以Karen再次取得了比赛的胜利 Translated by @matthew

题目描述

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 $ x_{1},x_{2},...,x_{n} $ and $ y_{1},y_{2},...,y_{n} $ 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 $ x_{i} $ xor $ y_{j} $ equals to one of the $ 2n $ integers. Here xor means the [bitwise exclusive or](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) 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.

输入输出格式

输入格式


The first line of input contains a positive integer $ n $ ( $ 1<=n<=2000 $ ) — the length of both sequences. The second line contains $ n $ space-separated integers $ x_{1},x_{2},...,x_{n} $ ( $ 1<=x_{i}<=2·10^{6} $ ) — the integers finally chosen by Koyomi. The third line contains $ n $ space-separated integers $ y_{1},y_{2},...,y_{n} $ ( $ 1<=y_{i}<=2·10^{6} $ ) — 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: $ x_{i}=y_{j} $ ; $ i≠j $ and $ x_{i}=x_{j} $ ; $ i≠j $ and $ y_{i}=y_{j} $ .

输出格式


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

输入输出样例

输入样例 #1

3
1 2 3
4 5 6

输出样例 #1

Karen

输入样例 #2

5
2 4 6 8 10
9 7 5 3 1

输出样例 #2

Karen

说明

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.

Input

题意翻译

题目描述 首先定义一个整形变量n,Koyomi和Karen都会分别选择n个不同的正整数,分别表示为X1,X2,...Xn和Y1,Y2,...Yn。它们不断重复显示它们的序列,并一直重复直到所有2n个整数变得不同,此时,这是唯一被保留和考虑的最终状态。 他们需要计算满足有序数对(i,j)[1<=i,j<=n]中(Xi ^ Yi)的值等于2n个整数之中任意一个整数的值的有序数对的数量。这里'^'意味着对两个整数的按位异或操作,并且在大多数编程语言中用'^','/'或'xor'表示 如果这样的配对数量是偶数时,Karen就可以取得胜利,否则Koyomi胜利。你需要帮助他们决出最近一场比赛的获胜者。 输入输出格式 输入格式 输入的第一行包含一个正整数n(1<=N<=2000)表示两个序列的长度。 第二行包含n个用空格分开的正整数X1,X2,...Xn(1<=Xi<=2*1e6)表示最后由Koyomi选择的正整数 第三行包含n个用空格分开的正整数Y1,Y2,...Yn(1<=Yi<=2*1e6)表示最后由Karen选择的正整数 输入数据保证给定的2n个正整数是两两不同的,也就是说,没有一对(i,j)[1<=i,j<=n]满足以下任意一项条件: 1.Xi=Yi 2.i≠j & Xi=Xj 3.i≠j & Yi=Yj 输出格式 输出一行表示获胜者的名字,即“Koyomi”或“Karen”(不含引号),注意大小写 样例解释 在样例1中,有6对满足条件的有序数对:(1,1),(1,2),(2,1),(2,3),(3,2),(3,3),因为6是偶数,所以Karen取得胜利 在样例2中,有16对满足条件的有序数对,所以Karen再次取得了比赛的胜利 Translated by @matthew

加入题单

上一题 下一题 算法标签: