2248B Merge to Match
待复习
本题活力0.28按难度、完成结果与训练证据估算
算法如山行则将至
题目描述
You are given two arrays a
and b
of lengths n
and m
, respectively. All n+m
integers in these arrays are distinct.
You can perform the following operation on a
any number of times (possibly, zero):
Choose two elements of a
with values x
and y
, where x≤y
.
Delete these two elements from a
.
Insert one integer z
into a
such that x≤z≤y
.
After performing all operations, you may arrange the elements of a
in any order.
Determine whether it is possible to make a
equal to b
.