← 返回 twosigma 的题目列表Merge Two Sorted Lists
类型:online_judge
Problem
Given two non-decreasing integer arrays A and B, merge them into a new non-decreasing array and print it.
Input (stdin)
Line 1: integers n m
Line 2: n integers for array A
Line 3: m integers for array B
Output (stdout)
Print the merged n+m integers separated by spaces
Constraints
0 <= n, m <= 2*10^5
Elements fit in 32-bit signed int
Expected time complexity O(n+m)
Examples
Example
Input
3 3
1 2 4
1 3 4
Output
1 1 2 3 4 4