Set Intersection
Find the intersection of two sets A={a0,a1,...,an−1}A={a0,a1,...,an−1} and B={b0,b1,...,bm−1}B={b0,b1,...,bm−1}.
Time Limit | 3 秒/Second(s) | Memory Limit | 512 兆字节/Megabyte(s) |
提交总数 | 8 | 正确数量 | 8 |
裁判形式 | 标准裁判/Standard Judge | 我的状态 | 尚未尝试 |
难度 | 分类标签 | STL 数学 |
Find the intersection of two sets A={a0,a1,...,an−1}A={a0,a1,...,an−1} and B={b0,b1,...,bm−1}B={b0,b1,...,bm−1}.
The input is given in the following format.
nn
a0 a1 ... an−1 a0 a1...an−1
mm
b0 b1 ... bm−1b0b1...bm−1
Elements of AA and BB are given in ascending order respectively. There are no duplicate elements in each set.
Print elements in the intersection in ascending order. Print an element in a line.
4
1 2 5 8
5
2 3 5 9 11
2
5
本题记录 | 用 户(点击查看用户) | 运行号(点击购买题解) | 时 间 |
---|---|---|---|
算法最快[0 ms] | Qiqy | 609125 | 2020-08-01 17:06:57 |
内存最少[2020 KB] | 却又像风捉摸不住 | 337118 | 2018-12-03 16:24:30 |
第一AC | 刘成健 | 322012 | 2018-11-21 11:03:36 |
第一挑战 | 刘成健 | 322012 | 2018-11-21 11:03:36 |
竞赛编号 | 竞赛名称 | 竞赛时间 | 访问比赛 |
---|