A. The Artful Expedient

题目链接http://codeforces.com/contest/869/problem/A

解题心得:就是一个水题,读懂题就好,题意是,(i,j)ai异或bi,统计ai异或bi得到的数能够在ai或bi中找的个数,如果是偶数输出Karen,否则输出Karen。

#include<bits/stdc++.h>
using namespace std;
const int maxn = 20000;
const int maxn2 = 2e7+100;
int num1[maxn],num2[maxn];
bool num[maxn2];
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",&num1[i]);
num[num1[i]] = true;//标记ai中出现过的数
}
for(int i=0;i<n;i++)
{
scanf("%d",&num2[i]);
num[num2[i]] = true;//标记bi中出现过的数
} //数据量比较小直接暴力双重循环
int sum = 0;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
{
int now = num1[i]^num2[j];
if(num[now])
sum++;
} if(sum%2)
printf("Koyomi");
else
printf("Karen"); return 0;
}

Codeforces Round #439 (Div. 2) A. The Artful Expedient的更多相关文章

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

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

  2. Codeforces Round #439 (Div. 2)

    A. The Artful Expedient 题目链接:http://codeforces.com/contest/869/problem/A 题目意思:给你两个数列,各包含n个数,现在让你从上下两 ...

  3. Codeforces Round #439 (Div. 2) 题解

    题目链接  Round 439 div2 就做了两道题TAT 开场看C题就不会 然后想了好久才想到. 三种颜色挑出两种算方案数其实是独立的,于是就可以乘起来了. E题想了一会有了思路,然后YY出了一种 ...

  4. Codeforces Round #439 (Div. 2) A B C

    强哉qls,这场div2竟是其出的!!! A. The Artful Expedient 暴力 ^ ,判断是否出现,有大佬根据亦或的性质推出 Karen 必赢,太强啦23333333333333. # ...

  5. 【Codeforces Round #439 (Div. 2) A】The Artful Expedient

    [链接] 链接 [题意] [题解] 暴力 [错的次数] 在这里输入错的次数 [反思] 在这里输入反思 [代码] #include <bits/stdc++.h> using namespa ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. Codeforces Round #439 (Div. 2) Problem A (Codeforces 869A) - 暴力

    Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-sc ...

随机推荐

  1. Codeforces 997D(STL+排序)

    D. Divide by three, multiply by two time limit per test 1 second memory limit per test 256 megabytes ...

  2. Elasticsearch之探索集群信息

    REST API 启动并运行了节点和集群,下一步是了解如何与它进行通信.elasticsearch提供了一个非常全面和强大的REST API,可以使用它与集群进行交付. 使用API完成以下: • 检查 ...

  3. Windows下打开某些软件时显示显卡驱动不是最新的问题

    在Windows下打开某些对显卡要求比较高的软件时,会出现某些显卡驱动不是最新,要求更新到最新的提示,但是当你真的去更新显卡驱动的时候,却发现现在的显卡驱动已经是最新了,那么为什么还会有这样的提示呢, ...

  4. python 多继承(新式类) 三

    深入super 一下内容引用自:http://www.cnblogs.com/lovemo1314/archive/2011/05/03/2035005.html,写的挺好的. 代码段3 class ...

  5. game 竞赛图 缩环

    [问题背景] zhx 和他的妹子(们)做游戏. [问题描述] 考虑 N 个人玩一个游戏, 任意两个人之间进行一场游戏 (共 N*(N-)/ 场) , 且每场一定能分出胜负. 现在,你需要在其中找到三个 ...

  6. java定时读取文件

    在项目中经常会用到定时器,在笔试或者面试中也会经常问到定时器和IO流. public class TimerDemo { public static void main(String[] args) ...

  7. Java中IO流文件读取、写入和复制

    //构造文件File类 File f=new File(fileName); //判断是否为目录 f.isDirectory(); //获取目录下的文件名 String[] fileName=f.li ...

  8. 压力测试工具segie的使用

    压力测试工具segie的使用 使用文档参考地址:https://www.joedog.org/siege-manual/ siege4地址:http://download.joedog.org/sie ...

  9. vba控制图表,excel图表,一键完成

    来源http://club.excelhome.net/thread-1417686-1-1.html 官方教程链接 https://docs.microsoft.com/zh-cn/office/v ...

  10. Objective-C - NSString 和 NSDate 互相轉換

    記錄一下在 Objective-C 由 NSString 轉換為 NSDate 或 NSDate 轉換為 NSString 的方法. 很簡單,使用 NSDateFormatter 就可以令 NSStr ...