Codeforces 994A. Fingerprints
题意
从x数组中找到最多的y数组中有的数字,按在x数组中出现的顺序输出。
注意
这题x数组和y数组都不会出现重复数字。
代码
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int x[15],y[15];
int main(){
ios::sync_with_stdio(false);
int n,m;
cin >> n >> m;
for(int i = 1;i <= n; ++i) cin >> x[i];
for(int i = 1;i <= m; ++i) cin >> y[i];
for(int i = 1;i <= n; ++i){
for(int j = 1;j <= m; ++j){
if(x[i] == y[j]){
cout << x[i] << " ";
}
}
}
cout << endl;
return 0;
}
Codeforces 994A. Fingerprints的更多相关文章
- 【Codeforces】Round #488 (Div. 2) 总结
[Codeforces]Round #488 (Div. 2) 总结 比较僵硬的一场,还是手速不够,但是作为正式成为竞赛生的第一场比赛还是比较圆满的,起码没有FST,A掉ABCD,总排82,怒涨rat ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
- CodeForces - 662A Gambling Nim
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...
- CodeForces - 274B Zero Tree
http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...
- CodeForces - 261B Maxim and Restaurant
http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...
- CodeForces - 696B Puzzles
http://codeforces.com/problemset/problem/696/B 题目大意: 这是一颗有n个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...
随机推荐
- 谷歌C++编程为何禁止缺省参数
C++的缺省参数尽量不要使用,结果可能出乎我们的意料,下面的程序大家看看输出结果是多少? ) cout << num << endl; ...
- 关于Linux操作系统层次结构分析
本文转自http://www.jb51.net/LINUXjishu/214104.html 首先来看一张图(这是Linux操作系统的大致层次结构): 最内层是硬件,最外层是用户常用的应用,比如说fi ...
- 如何修改wifi为家庭网络
一不小心手快,把新链接的 wifi 选择成“公用网络”了,使用过程中导致某些应用无法联网,那个恨呐!!! 幸好,咱们可以进行手工更改,哈哈,跟哥一起来操作: 进入”网络与共享中心界面": 选 ...
- 网络是通的 yum用不了
Loaded plugins: fastestmirror, langpacks One of the configured repositories failed (Unknown),and yum ...
- Python笔记13------pandas作图
1.pandas可以用来画DataFrame和Series的图 如: import numpy as npimport matplotlib.pyplot as pltimport pandas as ...
- 【XSY3347】串后缀
原题:2018 ICPC Asia-East Continent Final J 想看原题解的可以去看吉老师的直播题解 题意: 题解: (dllca膜你赛搬原题差评) 考虑题目中给出的式子的含义,实际 ...
- Project Euler 48 Self powers( 大数求余 )
题意: 项的自幂级数求和为 11 + 22 + 33 + - + 1010 = 10405071317. 求如下一千项的自幂级数求和的最后10位数字:11 + 22 + 33 + - + 100010 ...
- Git学习总结(4)——我的Git忽略文件
*.bak *.txt *.vm .gitignore #svn .svn/ # built application files *.apk *.ap_ # files for the dex VM ...
- [Node.js] Manage Configuration Values with Environment Variables
Storing configuration in files instead of the environment has many downsides, including mistakenly c ...
- 屌丝、小白怎么拿国内巨头offer
不久前,byvoid面阿里星计划的面试结果截图泄漏,引起无数IT屌丝的羡慕仰慕.看看这些牛人,NOI金牌.开源社区名人,三年级開始写Basic...在跪拜之余我们不禁要想,和这些牛人比,作为绝大部分技 ...