Problem 2624 --Binary Search - Includes

2624: Binary Search - Includes

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $14$ 正确数量 $12$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL

Includes 

For given two sequneces A={a0,a1,...,an−1} and B={b0,b1,...,bm−1}, determine whether all elements of B are included in A. 

Note that, elements of A and B are sorted by ascending order respectively.

The input is given in the following format. 

a0 a1,...,an−1 

b0 b1,...,bm−1 

The number of elements in A and its elements ai are given in the first and second lines respectively. 

The number of elements in B and its elements bi are given in the third and fourth lines respectively.

Print 1, if A contains all elements of B, otherwise 0.
4
1 2 3 4
2
2 4
1

1≤n,m≤200,000 

−1,000,000,000≤a0< a1< ...< an−1≤1,000,000,000 

−1,000,000,000≤b0< b1< ...< bm−1≤1,000,000,000

推荐代码 查看2624 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] Qiqy 609012 2020-07-31 08:28:37
内存最少[$1704 $KB] Qiqy 609012 2020-07-31 08:28:37
第一AC 计爱玲 282703 2018-10-07 21:23:40
第一挑战 计爱玲 282703 2018-10-07 21:23:40

赛题来源/所属竞赛 会津大学《C++ Programming II》 C++程序设计(高级)

竞赛编号 竞赛名称 竞赛时间 访问比赛