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 ...
随机推荐
- 502的错误其实不是nginx的问题,要从后端找原因。php-cgi进程数不够用、php执行时间长、或者是php-cgi进程死掉,都会出现502错误。
502的错误其实不是nginx的问题,要从后端找原因.php-cgi进程数不够用.php执行时间长.或者是php-cgi进程死掉,都会出现502错误.
- nginx 日志 log_format 及字段说明
1.log_format 普通格式 log_format main '$remote_addr - $remote_user [$time_local] $request ' '"$stat ...
- arcengine 将地图文件保存为图片(包括各种图片格式)
1,最近做了个地图文件输出图片的功能,思想主要就是利用MapControl的ActiveView中的out方法: 2代码如下:欢迎交流指正 SaveFileDialog m_save = new Sa ...
- ubuntu下安装无线网卡去驱动Qualcomm-Atheros-QCA9377
文件(文档和压缩包):http://pan.baidu.com/s/1mhktFT2
- idea npm 调试报错解决办法
1.用egg框架的开发时候,egg 提供本地开发和调试.点击idea 的debug 按钮时候报如下错误: Please specify npm or yarn package: cannot find ...
- kettle数据同步方法
1.实时性要求不高,采用全删全插的方式(适合于维度表.大数据量表) 2.有时间维度,直接从事实表同步的数据,可以采用根据时间字段进行筛选,增量同步.这个网上有很多例子,就不重复写了. 3.没有时间维度 ...
- idea报错:The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configu
java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more tha ...
- k8s 基础概念和术语
Master k8s里的master指的是集群控制节点,每个k8s集群里需要有一个Master节点来负责整个集群的管理和控制,基本k8s所有控制命令都发给它,它负责整个具体的执行过程,后面执行操作基本 ...
- iphone在jsp显示时间会NAN解决办法
例:2018-12-28 15:00:00 1. var newDate = new Date("2018-12-28 15:00:00") 这种获取的时间在安卓手机上显示是 ...
- 生成随机ID且唯一
var T = [ {P:11,G:2}, {P:101,G:7}, {P:1009,G:26}, {P:10007,G:59}, {P:100003,G:242}, {P:1000003,G:568 ...