Codeforces Round #439 (Div. 2) A. The Artful Expedient
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的更多相关文章
- Codeforces Round #439 (Div. 2)【A、B、C、E】
Codeforces Round #439 (Div. 2) codeforces 869 A. The Artful Expedient 看不透( #include<cstdio> in ...
- Codeforces Round #439 (Div. 2)
A. The Artful Expedient 题目链接:http://codeforces.com/contest/869/problem/A 题目意思:给你两个数列,各包含n个数,现在让你从上下两 ...
- Codeforces Round #439 (Div. 2) 题解
题目链接 Round 439 div2 就做了两道题TAT 开场看C题就不会 然后想了好久才想到. 三种颜色挑出两种算方案数其实是独立的,于是就可以乘起来了. E题想了一会有了思路,然后YY出了一种 ...
- Codeforces Round #439 (Div. 2) A B C
强哉qls,这场div2竟是其出的!!! A. The Artful Expedient 暴力 ^ ,判断是否出现,有大佬根据亦或的性质推出 Karen 必赢,太强啦23333333333333. # ...
- 【Codeforces Round #439 (Div. 2) A】The Artful Expedient
[链接] 链接 [题意] [题解] 暴力 [错的次数] 在这里输入错的次数 [反思] 在这里输入反思 [代码] #include <bits/stdc++.h> using namespa ...
- 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 ...
- 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 ...
- 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 ...
- Codeforces Round #439 (Div. 2) Problem A (Codeforces 869A) - 暴力
Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-sc ...
随机推荐
- 如何使用程序调用webApi接口
如何使用程序调用webApi接口 在C#中,传统调用HTTP接口一般有两种办法: WebRequest/WebResponse组合的方法调用 WebClient类进行调用. 第一种方法抽象程度较低,使 ...
- Codeforces Round #533(Div. 2) D.Kilani and the Game
链接:https://codeforces.com/contest/1105/problem/D 题意: 给n*m的地图,最多9个人,同时有每个人的扩张次数(我开始以为是直线扩张最大长度..实际是能连 ...
- Django blog项目知识点总结
数据库操作部分 当我们在Django项目中的models.py下写好创建表的代码后.为了创建好这些数据库表,我们再一次请出我的工程管理助手 manage.py.激活虚拟环境,切换到 manage.py ...
- Bingding模型
public abstract class Binding : IDefaultCommunicationTimeouts public virtual IChannelListener<TCh ...
- 3、从尾到头打印链表------------>剑指offer系列
题目 输入一个链表,按链表值从尾到头的顺序返回一个ArrayList. 分析 要了解链表的数据结构: val属性存储当前的值,next属性存储下一个节点的引用. 要遍历链表就是不断找到当前节点的nex ...
- AndroidStudio第一次提交项目代码到git服务器/github
虽然使用AndroidStudio(以下简称as)开发并使用git管理代码已经有很长时间,但是第一次提交项目到git依然会很不顺利,网上的文章或许因为所使用版本比较老,并不一定完全凑效,因此写此笔记做 ...
- 一次性删除数据库所有表和所有存储过程 SQL语句
一次性删除数据库所有表和所有存储过程 SQL语句 今天转移数据库数据,需要把数据库原来的表和存储过程清空.删除所有的表:如果由于外键约束删除table失败,则先删除所有约束: --/第1步****** ...
- c#网站对服务器的数据库的备份与还原
在网站上备份数据库 1.前台页面 <div> 需要备份的文件名:<asp:TextBox ID="bfFile" runat="server" ...
- bunzip2命令
bunzip2——解压缩.bz2格式文件 命令所在路径:/usr/bin/bunzip2 示例1: # bunzip2 yum.log.bz2 解压当前目录下的yum.log.bz2为yum.log, ...
- tomcat配置 —— 各个目录的作用
tomcat各目录(文件)作用 tomcat-7.0.50解压版,主目录一览: 我们可以看到主目录下有bin,conf,lib,logs,temp,webapps,work 7个文件夹,下面对他们分别 ...