题意

从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的更多相关文章

  1. 【Codeforces】Round #488 (Div. 2) 总结

    [Codeforces]Round #488 (Div. 2) 总结 比较僵硬的一场,还是手速不够,但是作为正式成为竞赛生的第一场比赛还是比较圆满的,起码没有FST,A掉ABCD,总排82,怒涨rat ...

  2. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  3. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  4. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

  5. 【Codeforces 738A】Interview with Oleg

    http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...

  6. CodeForces - 662A Gambling Nim

    http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...

  7. CodeForces - 274B Zero Tree

    http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...

  8. CodeForces - 261B Maxim and Restaurant

    http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...

  9. CodeForces - 696B Puzzles

    http://codeforces.com/problemset/problem/696/B 题目大意: 这是一颗有n个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...

随机推荐

  1. 《SLIC Superpixels》阅读笔记

    原始链接:http://blog.csdn.net/jkhere/article/details/16819285 或许有改动,请参考原文! SLIC 超像素(SLICSuperpixels) Rad ...

  2. Difference between == and ===

    In swift 3 and above === (or !==) Checks if the values are identical (both point to the same memory ...

  3. SourceInsight使用入门与技巧(转)

    1 sourceinsight screen font 的默认字体是Verdana的,它是一直变宽字体.在Document style中可以将字体改为定宽的Courier 2   document o ...

  4. JS中的map

    定义和用法: map() 方法返回一个新数组,数组中的元素为原始数组元素调用函数处理后的值. map() 方法按照原始数组元素顺序依次处理元素. 注意: map() 不会对空数组进行检测. 注意: m ...

  5. python与图灵机器人交互(ITCHAT版本)

    #!/usr/bin/env python#-*- coding:utf-8 -*- @Author : wujf @Time:2018/9/5 17:42import requestsimport ...

  6. kali 安装nessus

    下载home版: http://www.tenable.com/products/nessus/select-your-operating-system#tos 获取激活码:http://www.te ...

  7. 用div布局,页面copyright部分始终居于

    <!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content=&q ...

  8. IOS - 零碎

    ---恢复内容开始--- 1.模拟器目录: ProjectNameApk.documents.library(cache.preference.cookies).temp 2.Edit-Refacto ...

  9. Problem 4

    Problem 4 # Problem_4 """ A palindromic number reads the same both ways. The largest ...

  10. Docker学习总结(14)——从代码到上线, 云端Docker化持续交付实践

    2016云栖大会·北京峰会于8月9号在国家会议中心拉开帷幕,在云栖社区开发者技术专场中,来自阿里云技术专家罗晶(瑶靖)为在场的听众带来<从代码到上线,云端Docker化持续交付实践>精彩分 ...