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 Round #396 (Div. 2) A

    While Mahmoud and Ehab were practicing for IOI, they found a problem which name was Longest common s ...

  2. morphia(2)-添加

    1.简单 @Test public void add() throws Exception { final Employee em = new Employee("遥远2",500 ...

  3. watir-webdriver使用过程中异常

    1.在jruby版本1.6.7中,报异常:not such file to load --watir-webdriver 解决方法 :在文件的首行添加:require 'rubygems'       ...

  4. php调用c# webservice方法

    第一次用,通过,还没深入了解. 首先在php.ini中启用extension=php_soap.dll,重启apache. $Client=new SoapClient("url?wsdl& ...

  5. IP Addresses of Google Global Cache

    Bulgaria 93.123.23.1 93.123.23.2 93.123.23.3 93.123.23.4 93.123.23.5 93.123.23.6 93.123.23.7 93.123. ...

  6. MySQL select * 和把所有的字段都列出来,哪个效率更高?

    MySQL select * 和把所有的字段都列出来,哪个效率更高 答案是:如何,都不推荐使用 SELECT * FROM (1)SELECT *,需要数据库先 Query Table Metadat ...

  7. ZOJ 3466 The Hive II (插头DP,变形)

    题意:有一个n*8的蜂房(6边形的格子),其中部分是障碍格子,其他是有蜂蜜的格子,每次必须走1个圈取走其中的蜂蜜,在每个格子只走1次,且所有蜂蜜必须取走,有多少种取法? 思路: 以前涉及的只是n*m的 ...

  8. codevs 2919 选择题

    时间限制: 1 s  空间限制: 16000 KB  题目等级 : 黄金 Gold 题目描述 Description 某同学考试,在N*M的答题卡上写了A,B,C,D四种答案. 他做完了,又不能交,一 ...

  9. Vue+webpack+echarts+jQuery=demo

    需要的插件: "dependencies": { "bootstrap": "^3.3.7", "echarts": & ...

  10. 如何实现第二窗口不显示在windows下面的任务栏中

    将要隐藏的窗体的的ShowInTaskBar属性设置为false;就好了