2238 - I2P(I)2020_Huang_lab15 Scoreboard

Time

2020/12/31 08:00:00 2020/12/31 10:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
13084 Merge Two Arrays
13085 Merge Sort

13084 - Merge Two Arrays   

Description

Given two sorted arrays, implement the function merge(). Note that the two arrays are assumed to be next to each other (with contagious memory locations), and the first array is ahead of the second. You should replace the original two arrays by the result.

Input

The first line consists of two integers, one is the size of the first array and the other is the size of the second array.

The second line consists both elements in the first array and the second array (no newline).

Both arrays should be in increasing order.

Output

The first line is the size of the merged array.

The second line is the elements of the merged array.

There should be a newline at the end of the ouput!

Sample Input  Download

Sample Output  Download

Partial Judge Code

13084.c

Partial Judge Header

13084.h

Tags




Discuss




13085 - Merge Sort   

Description

Given an unsorted array. Implement the recursive MergeSort function. In the MergeSort(), you need to call the merge() function implemented in 13084 - Merge Two Arrays.

Input

The first line consists of the size of the array that needs to be sorted.

The second line consists of the elements of unsorted arrray.

Output

The first line consists of the elements of sorted array.

Sample Input  Download

Sample Output  Download

Partial Judge Code

13085.c

Partial Judge Header

13085.h

Tags




Discuss