codeforces 869A The Artful Expedient
来源:互联网 发布:什么是中文域名 编辑:程序博客网 时间:2024/05/29 07:34
题目链接:
http://codeforces.com/problemset/problem/869/A
题解:
直接map,炸了时间。以后还是老老实实写个find的函数。
心碎。
代码:
#include <map>#include <cmath>#include <vector>#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;#define inf 0x3f3f3f3f #define met(a,b) memset(a,b,sizeof(a))typedef long long ll;const int maxn = 2000+10;int num1[maxn],num2[maxn];map<int,int> mp;int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%d",&num1[i]); mp[num1[i]]++; } for(int i=0;i<n;i++) { scanf("%d",&num2[i]); mp[num2[i]]++; } int cnt=0; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { int x=num1[i]^num2[j]; if(mp.find(x)!=mp.end()) cnt++; } } if(cnt%2==0) printf("Karen\n"); else printf("Koyomi\n");}
阅读全文
0 0
- codeforces 869A The Artful Expedient
- Codeforces 869A. The Artful Expedient
- Codeforces 869A The Artful Expedient
- CodeForces 869A The Artful Expedient
- codeforces—— 869A —— The Artful Expedient
- A. The Artful Expedient
- A. The Artful Expedient
- Codeforces Round #439 (Div. 2) A. The Artful Expedient
- Codeforces Round #439 (Div. 2) A. The Artful Expedient
- Codeforces Round #439 (Div. 2) A. The Artful Expedient
- CF 869 A. The Artful Expedient【异或】
- CF 869 A. The Artful Expedient(异或)
- Codeforces869A The Artful Expedient
- 【codeforces869A】The Artful Expedient
- Codeforces Round #439 A The Artful Expedient 博弈解释 +暴力写法
- Codeforces Round #439 (Div. 2) The Artful Expedient
- codeforces The Artful Expedient(数学思维题)
- Codeforces Round #439 (Div. 2) The Artful Expedient
- 回调函数的简单应用
- 设计模式-行为-中介者
- Java七种排序算法教程
- Python 访问私有变量和私有方法
- 【图像处理】MATLAB:频域处理
- codeforces 869A The Artful Expedient
- 剑指Offer题目1519:合并两个排序的链表
- 第二十二课(一)、高级SQL特性
- LeedCode ZigZag Conversion
- 【实战】4-8 项目包结构初始化
- 设计模式-行为-备忘录
- less语法介绍
- UVAlive6620 Josephina and RPG
- Racing Gems